Skip to content

Commit 60b0507

Browse files
committed
fix: give github token correct permissions
1 parent ba2b9b7 commit 60b0507

File tree

2 files changed

+45
-15
lines changed

2 files changed

+45
-15
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,22 @@ name: Go
66
on:
77
push:
88
branches: ["main"]
9-
tags:
10-
- "v*"
119
pull_request:
1210
branches: ["main"]
1311

1412
jobs:
1513
build:
1614
runs-on: ubuntu-latest
1715
steps:
18-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1917

2018
- name: Set up Go
21-
uses: actions/setup-go@v3
19+
uses: actions/setup-go@v5
2220
with:
23-
go-version: 1.23
21+
go-version: stable
2422

2523
- name: Build
2624
run: go build -v ./...
2725

2826
- name: Test
2927
run: go test -v ./...
30-
31-
- name: Run GoReleaser
32-
uses: goreleaser/goreleaser-action@v6
33-
if: success() && startsWith(github.ref, 'refs/tags/')
34-
with:
35-
distribution: goreleaser
36-
version: "~> v2"
37-
args: release --clean
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# .github/workflows/release.yml
2+
name: goreleaser
3+
4+
on:
5+
pull_request:
6+
push:
7+
# run only against tags
8+
tags:
9+
- "*"
10+
11+
permissions:
12+
contents: write
13+
# packages: write
14+
# issues: write
15+
# id-token: write
16+
17+
jobs:
18+
goreleaser:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: stable
29+
# More assembly might be required: Docker logins, GPG, etc.
30+
# It all depends on your needs.
31+
- name: Run GoReleaser
32+
uses: goreleaser/goreleaser-action@v6
33+
with:
34+
# either 'goreleaser' (default) or 'goreleaser-pro'
35+
distribution: goreleaser
36+
# 'latest', 'nightly', or a semver
37+
version: "~> v2"
38+
args: release --clean
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
42+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

0 commit comments

Comments
 (0)