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

Skip running the "unpublish temp tags" step in CI for PRs #270

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Mar 20, 2024

Currently the "unpublish temp tags" GitHub Actions step is always run, even if no tags were generated that run (such as for PRs, where we don't publish anything).

Whilst this doesn't cause any harm normally, when contributors open a PR from a fork, the "unpublish temp tags" will fail since it doesn't have access to the secrets required to perform the (redundant) unpublish.

As such, the step now uses the same if ref-related conditionals that the publish step itself uses (so we only try to unpublish if this was a job type that publishes something).

This fixes the failures seen in #269:
https://github.com/heroku/base-images/actions/runs/8351455845/job/22859813877?pr=269

GUS-W-15292389.

Currently the "unpublish temp tags" GitHub Actions step is always
run, even if no tags were generated that run (such as for PRs, where
we don't publish anything).

Whilst this doesn't cause any harm normally, when contributors open
a PR from a fork, the "unpublish temp tags" will fail since it doesn't have
access to the secrets required to perform the (redundant) unpublish.

As such, the step now uses the same `if` ref-related conditionals that
the publish step itself uses (so we only try to unpublish if this was a job
type that publishes something).

This fixes the failures seen in #269:
https://github.com/heroku/base-images/actions/runs/8351455845/job/22859813877?pr=269
@edmorley edmorley self-assigned this Mar 20, 2024
@edmorley edmorley marked this pull request as ready for review March 20, 2024 09:14
@edmorley edmorley requested a review from a team as a code owner March 20, 2024 09:14
@edmorley edmorley merged commit d135cbe into main Mar 20, 2024
4 checks passed
@edmorley edmorley deleted the edmorley/fix-ci-forks branch March 20, 2024 09:36
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.

2 participants