From 27d50ad8323b304913ffeb6fb24ceeaae96ce0ca Mon Sep 17 00:00:00 2001 From: James Carnegie Date: Mon, 10 Feb 2025 10:37:13 +0000 Subject: [PATCH] chore: add write permission for gh release --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad637ac..84431d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,8 @@ on: push: tags: - "v*.*.*" - +permissions: + contents: write jobs: publish: name: Build and Publish @@ -25,9 +26,9 @@ jobs: mkdir -p dist GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/cofidectl-${{ matrix.goos }}-${{ matrix.goarch }}-${{ github.ref_name }} ./cmd/cofidectl/main.go - name: Upload artifacts + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release list --limit 1 | grep -q ${{ github.ref_name }} || gh release create ${{ github.ref_name }} -d gh release upload ${{ github.ref_name }} dist/cofidectl-${{ matrix.goos }}-${{ matrix.goarch }}-${{ github.ref_name }} --clobber gh release upload ${{ github.ref_name }} LICENSE --clobber - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file