Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore previously failed checks on pull_request edited #383

Open
perryao opened this issue Oct 24, 2024 · 3 comments
Open

Ignore previously failed checks on pull_request edited #383

perryao opened this issue Oct 24, 2024 · 3 comments

Comments

@perryao
Copy link

perryao commented Oct 24, 2024

We have a workflow that checks the format of a PR title and it runs on

on:
  pull_request:
    types:
      - opened
      - synchronize
      - reopened
      - edited

If I open a PR with a title that fails this check, our summary workflow below fails as expected:

name: Summary
on:
  pull_request:
    types: [opened, synchronize, reopened, edited]
jobs:
  require-all-checks:
    name: Require All Checks
    runs-on: ubuntu-latest
    permissions:
      checks: read
    steps:
      - name: Wait for Status Checks
        uses: poseidon/[email protected]
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          ignore: Require All Checks
          ignore_pattern: '\[Optional\].*'

However, if I edit the PR title and get the PR title workflow to run again and pass, the require-all-checks workflow still fails.

Is there a way to ignore previous failures on pull request edited triggers?

@tylermichael
Copy link

image

It looks like this API call returns the last runs and all their attempts by default, not just the last runs and their last attempt.

There would need to be code added to filter out just the previous runs and only look at the most recent attempts. IMO, that makes sense for this check to do.

@bjhargrave
Copy link
Contributor

For type edited, the event payload.pull_request.head.sha is unchanged from the previous workflow run on the PR. Since this is the commit SHA used to locate the check runs, the check runs from the previous workflow run are visible. So the failed check-pr-title check run from the prior execution is visible before the new execution completes and updates the check run result to success. You probably need some other synchronization to ensure the check-pr-title job_id runs before the check status action checks it.

@tylermichael
Copy link

It fails even after you manually re-run the wait for status check. Only pushing a new commit allows it to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants