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

ci: fix release assets not available #444

Merged
merged 1 commit into from
May 11, 2023
Merged

Conversation

apricote
Copy link
Member

@apricote apricote commented May 9, 2023

The default token GH_TOKEN in workflows does not trigger new events. We rely on the "tag" event created by release-please to build our release assets.

By using a token for "hcloud-bot", the event will be properly created.

We explicitly only run the workflow job if the repository is the main repo, as otherwise this workflow will fail in forks because the secret is not available.

See also hetznercloud/cli#476

The default token GH_TOKEN in workflows does not trigger new events.
We rely on the "tag" event created by release-please to build our
release assets.

By using a token for "hcloud-bot", the event will be properly created.

We explicitly only run the workflow job if the repository is the main
repo, as otherwise this workflow will fail in forks because the secret
is not available.
@apricote apricote self-assigned this May 9, 2023
@apricote apricote requested a review from a team as a code owner May 9, 2023 12:33
@@ -6,10 +6,14 @@ name: release-please

jobs:
release-please:
# The secret HCLOUD_BOT_TOKEN is only available on the main repo, not in forks.
if: github.repository == 'hetznercloud/hcloud-cloud-controller-manager'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm, we could also detect if the secret is set here, right? Not sure how hard we should work here to ensure releases can be cut for forks, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how hard we should work here to ensure releases can be cut for forks, though.

Not at all in my opinion, thats why I just deactived the workflow for forks.

If left running for forks, this will create notifications of failing workflows for people having forks, i encountered this issue with the cluster-api-provider-hetzner.

@apricote apricote merged commit 1291b76 into main May 11, 2023
10 checks passed
@apricote apricote deleted the fix-release-please-permissions branch May 11, 2023 07:38
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.

None yet

2 participants