From 3cfe215d4c3490703b136d51c8ddbbb85fc4afa2 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 14 Dec 2022 12:16:24 -0300 Subject: [PATCH] docs: update github-action documentation (#3640) Using the new version (v4) everywhere. Signed-off-by: Carlos A Becker --- www/docs/ci/actions.md | 6 ++--- www/docs/cookbooks/override-image-name.md | 27 ++++++++++++++----- .../resource-not-accessible-by-integration.md | 10 ++++--- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/www/docs/ci/actions.md b/www/docs/ci/actions.md index 53505fc87be..6670185baec 100644 --- a/www/docs/ci/actions.md +++ b/www/docs/ci/actions.md @@ -40,7 +40,7 @@ jobs: cache: true # More assembly might be required: Docker logins, GPG, etc. It all depends # on your needs. - - uses: goreleaser/goreleaser-action@v2 + - uses: goreleaser/goreleaser-action@v4 with: # either 'goreleaser' (default) or 'goreleaser-pro': distribution: goreleaser @@ -94,7 +94,7 @@ the [Import GPG][import-gpg] GitHub Action along with this one: passphrase: ${{ secrets.PASSPHRASE }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v4 with: version: latest args: release --rm-dist @@ -176,7 +176,7 @@ step will look like this: ```yaml - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v4 with: version: latest args: release --rm-dist diff --git a/www/docs/cookbooks/override-image-name.md b/www/docs/cookbooks/override-image-name.md index 9cb3c9259a6..bf230bcd61e 100644 --- a/www/docs/cookbooks/override-image-name.md +++ b/www/docs/cookbooks/override-image-name.md @@ -1,10 +1,23 @@ # Override hardcoded registry and image name ? -If you are curious about how to avoid hard-coded registry and image names within your `.goreleaser.yml`, we have good news for you. Here is the solution. Suppose you haven't been aware of GoReleaser Action, which allows you to install GoReleaser binary in your workflow easily. In that case, this is the right time to be mindful of that because, in this section, we'll give an example through GoReleaser's GitHub Action. +If you are curious about how to avoid hard-coded registry and image names within +your `.goreleaser.yml`, we have good news for you. Here is the solution. Suppose +you haven't been aware of GoReleaser Action, which allows you to install +GoReleaser binary in your workflow easily. In that case, this is the right time +to be mindful of that because, in this section, we'll give an example through +GoReleaser's GitHub Action. -> To get more detail about the GoReleaser's GitHub Action, please [see](https://github.com/goreleaser/goreleaser-action). +> To get more detail about the GoReleaser's GitHub Action, please +> [see](https://github.com/goreleaser/goreleaser-action). -As you can see from the description [here](https://github.com/goreleaser/goreleaser-action#environment-variables), you can pass environment variables to the GoReleaser to use within the `.goreleaser.yml` via syntax `{{ .Env. }}`. So, let' define our registry and image names as an [environment variable in the workflow](https://docs.github.com/en/actions/learn-github-actions/environment-variables), then pass those to the GoReleaser via `env` section of the GoReleaser's GitHub Action like the following: +As you can see from the description +[here](https://github.com/goreleaser/goreleaser-action#environment-variables), +you can pass environment variables to the GoReleaser to use within the +`.goreleaser.yml` via syntax `{{ .Env. }}`. So, let' define our +registry and image names as an [environment variable in the +workflow](https://docs.github.com/en/actions/learn-github-actions/environment-variables), +then pass those to the GoReleaser via `env` section of the GoReleaser's GitHub +Action like the following: ```YAML jobs: @@ -16,7 +29,7 @@ As you can see from the description [here](https://github.com/goreleaser/gorelea IMAGE_NAME: "google/addlicense" ... - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v4 with: distribution: goreleaser version: latest @@ -27,7 +40,8 @@ As you can see from the description [here](https://github.com/goreleaser/gorelea GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` -Once you pass those to the GoReleaser, you can access them within your `.goreleaser.yml` file as I mentioned above, here is the example of this: +Once you pass those to the GoReleaser, you can access them within your +`.goreleaser.yml` file as I mentioned above, here is the example of this: ```YAML dockers: @@ -45,4 +59,5 @@ dockers: - "--platform=linux/amd64" ``` -That's all we need to do, you even might be surprised when you notice that how easy it is to overcome this issue. +That's all we need to do, you even might be surprised when you notice that how +easy it is to overcome this issue. diff --git a/www/docs/errors/resource-not-accessible-by-integration.md b/www/docs/errors/resource-not-accessible-by-integration.md index 83ff2cba0c3..457ec3a82fd 100644 --- a/www/docs/errors/resource-not-accessible-by-integration.md +++ b/www/docs/errors/resource-not-accessible-by-integration.md @@ -1,8 +1,10 @@ # Resource not accessible by integration -When using GitHub Actions, you might feel tempted to use the action-bound `GITHUB_TOKEN`. +When using GitHub Actions, you might feel tempted to use the action-bound +`GITHUB_TOKEN`. -While it is a good practice, and should work for most cases, if your workflow writes a file in another repository, you may see this error: +While it is a good practice, and should work for most cases, if your workflow +writes a file in another repository, you may see this error: ```sh тип release failed after 430.85s error=homebrew tap formula: failed to publish artifacts: PUT https://api.github.com/repos/user/homebrew-tap/contents/Formula/scorecard.rb: 403 Resource not accessible by integration [] @@ -25,7 +27,7 @@ You'll need to add it as secret and pass it to the action, for instance: ```yaml # .github/workflows/goreleaser.yaml # ... - - uses: goreleaser/goreleaser-action@v2 + - uses: goreleaser/goreleaser-action@v4 env: GITHUB_TOKEN: ${{ secrets.GH_PAT }} # ... @@ -42,7 +44,7 @@ We would need to change the workflow file: ```yaml # .github/workflows/goreleaser.yaml # ... - - uses: goreleaser/goreleaser-action@v2 + - uses: goreleaser/goreleaser-action@v4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}