-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use github.ref_name instead of hardcoded branch name #4085
Conversation
.github/workflows/coverage.yml
Outdated
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: us-east-1 | ||
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | ||
if: github.event_name != 'pull_request' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only run the workflow on push or prs on the branch specified at the top of the file, so I think we really only need to check that it's not a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the event_name
that triggers the build when you push to an open PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no if: github.event_name == 'push'
it makes clear we are only interested in push events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original version I found on stack overflow. I think the original intention for using != 'pull_request'
is that you could trigger the workflow manually if enabled (if configured).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the
event_name
that triggers the build when you push to an open PR?
Not sure, I suspect still pull_request
This PR updates the coverage and doc workflows to use
github.ref_name
instead of a hard coded branch name for the s3 path.This way there's nothing to update in this part of the workflows when we create a new branch of off
main
.