-
Notifications
You must be signed in to change notification settings - Fork 4
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
Waiting for a branch to finish all checks before running #1
Comments
Hey @te-online, thanks for using the action! Sorry for the late reply. Not sure why I didn't get a notification... That's exactly the problem this action is meant to solve. In fact there's an automated test that checks for this exact use case (https://github.com/jitterbit/await-check-suites/blob/master/.github/workflows/test.yml#L78-L118). Not sure why it isn't working for you. Some questions I have for you that may seem obvious:
One way you can test #2 is by running the following GITHUB_REPO='<repo here>' # e.g., jitterbit/await-check-suites
GITHUB_PAT='<personal access token here>'
curl --silent --header "Authorization: Bearer $GITHUB_PAT" --header 'Accept: application/vnd.github.antiope-preview+json' \
"https://api.github.com/repos/$GITHUB_REPO/commits/dev/check-suites" | less |
Thanks for getting back to me. Didn't have time to look at your answer thoroughly. Re. 1. Yes, it's on the same repo. I have this in the yaml-file
But the problem might just be that I don't fully understand Github Actions, yet. Re. 2. I'll check that out, thanks! |
I was able to make it work more reliably 😊 on:
push:
branches:
- dev
name: Deploy dev branch
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- uses: jitterbit/await-check-suites@v1
with:
# The commit's ref (can be a SHA, branch name, or a tag name).
# Default: ${{ github.sha }}
ref: 'dev'
# Wait for a check suite to be created if none exist.
# This is important to protect against race conditions
# if you know a check suite should exist on the `ref`'s commit.
# Default: true
# waitForACheckSuite: true
# Number of seconds to wait before timing out.
timeoutSeconds: 15
# Fail step if any of the check suites complete with a conclusion other than 'success'.
# Default: true
failStepIfUnsuccessful: false
- uses: actions/checkout@master
- uses: actions/setup-node@v1
... I lowered the timeout to 15 seconds, because I realized that it's the timeout to wait for a “green light“ (in lack of a better term). If within this timeout there's still another check suite running, it's just going to fail the later test suite, which is what I expected. However, I was still able to reproduce the race-condition (even though Edit: Okay, maybe I misinterpreted the Edit 2: One thing I noticed about the URL you put in your response – if I hit this endpoint, I only ever get one check-suite, even if multiple ones are running. |
Just to be clear about your use case, you only have this one workflow that triggers on the
Is this a public repo by chance? |
Thanks so much for your response and apologies for my late reply. I have the config as you describe, but still can't make it work. The repo is private, but I can re-create this in a public repo. However, I'll need some more time to do this. Will try to get to it next week. Thanks again. |
Okay, here's the test case: https://github.com/te-online/await-check-suites-test/actions Thanks already for your efforts so far. I'm sorry to bother you with this, if this is just an uncovered use-case or some config error 🙈 |
Not a problem. Thanks for using this action!
The action (silently) failed because the ref Edit: There we go. I triggered
Yes, looks like it's having an issue with the lerna package. |
Yeah, that was a copy and paste error on my side 😅. This issue doesn't exist on the actual repository.
That looks good, I agree :-) However, our setup has to wait only for its own ref to finish other actions and not for other refs. I adjusted the config. A simple test went just fine. I have no idea what changed... 🎉 |
Awesome! So it’s working in your private repo now? If so I’ll close this ticket out. |
I seems like it 😊 I'll keep you posted on any updates |
Thanks a lot for publishing this action!
Can this action be used to wait for actions on one branch, so they're only ever run sequentially? I tried this config, but it doesn't seem to find other running checks (maybe because they're from another commit?).
I pushed to
dev
in short sequence and two checks were running. Result:The text was updated successfully, but these errors were encountered: