-
Notifications
You must be signed in to change notification settings - Fork 1
ci: read Go version from go.mod instead of hardcoding it #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: Setup Go and Build | ||
| description: Checkout repo, set up Go version from go.mod, and compile the project | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| cache: true | ||
|
|
||
| - name: Build | ||
| shell: bash | ||
| run: go build ./... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,15 +12,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.25' | ||
| cache: true | ||
|
|
||
| - name: Build | ||
| run: go build ./... | ||
| - uses: ./.github/actions/setup-and-build | ||
|
|
||
|
Comment on lines
14
to
16
|
||
| - name: Restore build cache | ||
| uses: actions/cache@v5 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,14 +12,7 @@ jobs: | |
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.25' | ||
|
|
||
| - name: Build | ||
| run: go build ./... | ||
| - uses: ./.github/actions/setup-and-build | ||
|
|
||
|
Comment on lines
14
to
16
|
||
| - name: Post to Buttondown | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,14 +15,7 @@ jobs: | |
| contents: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.25' | ||
|
|
||
| - name: Build | ||
| run: go build ./... | ||
| - uses: ./.github/actions/setup-and-build | ||
|
|
||
|
Comment on lines
17
to
19
|
||
| - name: Create credentials.json | ||
| run: | | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This composite action enables
cache: trueforactions/setup-go. Some workflows in this PR set job-levelpermissions:(e.g.,contents: read/write), which can implicitly drop theactionsscope; that can prevent the cache from being saved/restored and cause the job to fail with permission errors. Consider either (a) making caching configurable via an input (default off), or (b) updating the affected workflows’permissionsto include the minimum requiredactions: read/actions: writefor caching.