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

Fix CI for push events #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix CI for push events #135

wants to merge 1 commit into from

Conversation

DigitalBrains1
Copy link
Member

If a push triggers a GitHub Action, it does not have the property github.head_ref, leading to an immediate failure. We generally solve this by falling back to github.run_id.

Note that if it does fall back to run_id becasue head_ref was unset, the cancel-in-progress will not work since the run ID is unique for the run, so there will never be multiple runs in a single concurrency group.

https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value

Additionally, it is now possible to manually trigger a CI run. If the last run for the main branch was so long ago that its caches expired, and you open multiple PR's before merging one, each PR will have to rebuild all dependencies because they only can get their caches from the main branch or that specific PR. If you know this is what is going to happen, you could trigger a CI run on main to have fresh caches, and only open the PR's after that.

If a push triggers a GitHub Action, it does not have the property
`github.head_ref`, leading to an immediate failure. We generally solve
this by falling back to `github.run_id`.

Note that if it does fall back to run_id becasue head_ref was unset, the
`cancel-in-progress` will not work since the run ID is unique for the
run, so there will never be multiple runs in a single concurrency group.

https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value

Additionally, it is now possible to manually trigger a CI run. If the last run for the main branch was so long ago that its caches expired, and you open multiple PR's before merging one, each PR will have to rebuild all dependencies because they only can get their caches from the main branch or that specific PR. If you know this is what is going to happen, you could trigger a CI run on main to have fresh caches, and only open the PR's after that.
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

Successfully merging this pull request may close these issues.

1 participant