Skip to content

Commit

Permalink
ci: success in forked repository (#670)
Browse files Browse the repository at this point in the history
There're two workflows in forked repository that will fail: `docker-image.yml` and `release.yml`.

`docker-image.yml` fails because the secrets it needs does not exist in forked repository. Running it only in the `jeessy2/ddns-go` repository to fix this.

`release.yml` fails because the default `GITHUB_TOKEN` permission is now read-only. Add `contents: write` to fix this.

References:
- https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-only-run-job-for-specific-repository
- https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
- https://github.com/goreleaser/goreleaser-action#environment-variables
  • Loading branch information
WaterLemons2k committed Apr 12, 2023
1 parent 62bd142 commit 7aa0b18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

jobs:
buildx-dockerhub:
if: github.repository == 'jeessy2/ddns-go'
runs-on: ubuntu-latest
env:
DOCKER_REPO: ${{ secrets.DOCKER_USERNAME }}/ddns-go
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
contents: write

jobs:
goreleaser:
name: Build
Expand Down

0 comments on commit 7aa0b18

Please sign in to comment.