Skip to content

Commit 865a92b

Browse files
update workflows (#13)
1 parent 2e2b991 commit 865a92b

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

.github/workflows/generate-tag.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,31 @@ on:
99
jobs:
1010
generate-tag:
1111
name: Generate tag
12-
runs-on: ubuntu-latest
12+
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
1313
steps:
1414
- name: Check out code
1515
uses: actions/checkout@master
1616
with:
1717
fetch-depth: '0'
1818

19+
- name: Checkout github-tag-action
20+
uses: actions/checkout@v3
21+
with:
22+
repository: ${{ vars.GENERATE_TAG_REPO || 'anothrNick/github-tag-action' }}
23+
ref: ${{ vars.GENERATE_TAG_REF || '1.62.0' }}
24+
path: ./.github/action${{ vars.GENERATE_TAG_PATH || '/github-tag-action/' }}
25+
token: ${{ vars.GENERATE_TAG_SECRET && secrets[vars.GENERATE_TAG_SECRET] || secrets.GITHUB_TOKEN }}
26+
27+
# Generate tag if commit message contains #major or #patch or #patch
1928
- name: Bump version and push tag
2029
id: generate_tag
21-
uses: anz-bank/github-tag-action@1.40.0
30+
uses: ./.github/action/github-tag-action
2231
env:
32+
# An action in a workflow run can't trigger a new workflow run.
33+
# When you use GITHUB_TOKEN in your actions, all of the interactions
34+
# with the repository are on behalf of the Github-actions bot.
35+
# The operations act by Github-actions bot cannot trigger a new workflow run.
36+
# More details: https://help.github.com/en/actions/reference/events-that-trigger-workflows#about-workflow-events
2337
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2438
WITH_V: true
2539
DEFAULT_BUMP: patch

.github/workflows/go.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ on:
55
- master
66
- pre-generics
77
pull_request:
8-
jobs:
98

9+
env:
10+
GOPROXY: ${{ vars.GOPROXY }}
11+
12+
jobs:
1013
lint:
1114
name: Lint
12-
runs-on: ubuntu-latest
15+
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
1316
steps:
1417
- name: Set up Go
1518
uses: actions/setup-go@v3
@@ -21,14 +24,16 @@ jobs:
2124

2225
- name: Run golangci-lint
2326
uses: golangci/golangci-lint-action@v3
24-
with:
25-
version: v1.48
2627

2728
build:
2829
name: Build
29-
runs-on: ubuntu-latest
30-
container: golang:1.19
30+
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
3131
steps:
32+
- name: Set up Go
33+
uses: actions/setup-go@v3
34+
with:
35+
go-version: 1.19
36+
3237
- name: Check out code into the Go module directory
3338
uses: actions/checkout@v3
3439

@@ -37,9 +42,13 @@ jobs:
3742

3843
test:
3944
name: Test
40-
runs-on: ubuntu-latest
41-
container: golang:1.19
45+
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
4246
steps:
47+
- name: Set up Go
48+
uses: actions/setup-go@v3
49+
with:
50+
go-version: 1.19
51+
4352
- name: Check out code into the Go module directory
4453
uses: actions/checkout@v3
4554

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ linters:
3939
- gocyclo
4040
- gofmt
4141
- goimports
42-
- revive
42+
# - revive
4343
- gosec
4444
- gosimple
4545
- govet

errors/error.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313

1414
type Error string
1515

16+
//nolint:errcheck // This is assigning to _ as an error type, not ignoring an error return
1617
var _ error = Error("")
1718

1819
func (p Error) Error() string {

parser/scope.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ const invalidCutpoint = Cutpointdata(-1)
8181

8282
func (s Scope) ReplaceCutPoint(force bool) (newScope Scope, prev, replacement Cutpointdata) {
8383
prev = s.GetCutPoint()
84-
replacement = invalidCutpoint
8584
if prev.valid() || force {
8685
// TODO: What's with the random number?
8786
replacement = Cutpointdata(rand.Int31()) //nolint:gosec

0 commit comments

Comments
 (0)