Skip to content

[MNT]: [ci doc] doesn't skip Github tests. #26693

Open

Description

@jklymak

Summary

When putting [ci doc] in the commit message, the GitHub tests all still run.

!contains(github.event.head_commit.message, '[ci doc]')
is supposed to cause a skip, but I suspect #25145 broke this?

ping @ksunden

Proposed fix

No response

Activity

  1. ksunden commented on Sep 4, 2023

    @ksunden
    Member

    That PR is the one that introduced the behavior to skip on [ci doc], prior to that it wasn't accounted for.

    I tested it in that PR by adding an empty commit and it didn't run gha (appveyor still ran, I believe)

    As far as I can tell, it worked for the most recent commit of #26669 (a84ab3d).

    Note that it does only take into account the most recent commit message, not all commits of the PR.

    Also, only the tests workflow is skipped, not all gha workflows, so linting/pr cleanliness, mypy, etc still do run, but those are all pretty quick checks.

  2. rcomer commented on Sep 4, 2023

    @rcomer
    Member

    Quoting myself from #25383 (comment)

    the GitHub Actions tests still ran!

    Yeah, I've been digging around the docs for that, as I've noticed it before. From what I can tell, head_commit is a property of a push event, but not of a pull_request event. So possibly it just can't work for PR CI?

  3. ksunden commented on Sep 4, 2023

    @ksunden
    Member

    Hmmm.... I mean just looking at #26669, that does not show the tests as having run for the PR status checks, so it doesn't seem to be a universal thing, but perhaps it doesn't work on initial opening of the PR, but does for subsequent pushes?

    Would have to test it out to see the boundaries.

  4. rcomer commented on Sep 4, 2023

    @rcomer
    Member

    #26669 only touches files under doc and galleries, so will also be affected by these lines:

    paths-ignore:
    # Skip running tests if changes are only in documentation directories
    - 'doc/**'
    - 'galleries/**'

  5. jklymak commented on Sep 4, 2023

    @jklymak
    MemberAuthor

    2065f14 ran all the Github tests despite the commit message being [ci doc]

    However, I did not make the initial commit have this in the commit message. Is that the difference?

  6. jklymak commented on Sep 4, 2023

    @jklymak
    MemberAuthor

    Sorry, I meant #25175 broke this.

    the logic is indeed different: if github.event_name == 'workflow_dispatch' is True then the workflow runs, even if '[ci doc]' is in the commit message. Is it possible workflow_dispatch is True in these runs? From the docs it seems it should not be, but??

  7. ksunden commented on Sep 4, 2023

    @ksunden
    Member

    "workflow_dispatch" is the keyword for "manually run action", i.e. running the action by clicking the "Run workflow" button in the GHActions web UI.

    I think if you are asking explicitly to run a workflow, it should run, regardless of whether the last commit has a [ci skip] in it or not, so I think that logic is sound.

    I do wonder if "ignore paths" causes empty commits to skip, which made it look like it was working when I was testing it, though.

  8. rcomer commented on Sep 5, 2023

    @rcomer
    Member

    The paths_ignore was added at #25261, so more recently than the #25145 testing.

  9. rcomer commented on Dec 30, 2025

    @rcomer
    Member

    scipy does this by having a separate workflow to check the commit message and then making the tests conditional on the return value of that workflow.
    https://github.com/scipy/scipy/blob/main/.github/workflows/commit_message.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions