Skip to content

fix: publishing packages to GitHub requires write permissions (#251) #35

fix: publishing packages to GitHub requires write permissions (#251)

fix: publishing packages to GitHub requires write permissions (#251) #35

Workflow file for this run

name: goreleaser
on:
push:
tags:
- '*'
# Declare default permissions as read only.
permissions: read-all
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
# https://goreleaser.com/ci/actions/#token-permissions
contents: write
packages: write
steps:
-
name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
-
name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
-
name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ^1.19
cache: true
-
name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}