Skip to content

Commit

Permalink
ci: fix release assets not available (#444)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
apricote committed May 11, 2023
1 parent b54ee8b commit 1291b76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.HCLOUD_BOT_TOKEN }}
release-type: go
package-name: hcloud-cloud-controller-manager

Expand Down

0 comments on commit 1291b76

Please sign in to comment.