Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit 23d28c5

Browse files
committed
feat: initialize Go module and add dependencies
1 parent 261551c commit 23d28c5

28 files changed

Lines changed: 1525 additions & 0 deletions

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.md]
10+
indent_style = space
11+
indent_size = 4
12+
max_line_length = 120
13+
14+
[*.yml]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.go]
19+
indent_style = tab
20+
indent_size = 4
21+
max_line_length = 120

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Actionlint
3+
permissions:
4+
contents: read
5+
on:
6+
pull_request:
7+
merge_group:
8+
jobs:
9+
actionlint:
10+
runs-on: ubuntu-24.04
11+
permissions:
12+
contents: read
13+
statuses: write
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2
17+
with:
18+
fail_level: any
19+
filter_mode: nofilter
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: pr-build-and-test
3+
permissions:
4+
contents: read
5+
on:
6+
pull_request:
7+
branches: ["main"]
8+
jobs:
9+
pr-build-and-test:
10+
runs-on: ubuntu-24.04
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
modules:
15+
- cmd/github-actions-digest-pinner
16+
- internal/finder
17+
- internal/ghclient
18+
- internal/parser
19+
- internal/updater
20+
steps:
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
23+
with:
24+
cache: 'false'
25+
go-version: '1.24.3'
26+
- run: go build -v .
27+
working-directory: ${{matrix.modules}}
28+
- run: go test -v .
29+
working-directory: ${{matrix.modules}}

.github/workflows/pr-golint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Golanglint
3+
permissions:
4+
contents: read
5+
on:
6+
pull_request:
7+
jobs:
8+
Golanglint:
9+
runs-on: ubuntu-24.04
10+
permissions:
11+
contents: read
12+
statuses: write
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
modules:
17+
- cmd/github-actions-digest-pinner
18+
- internal/finder
19+
- internal/ghclient
20+
- internal/parser
21+
- internal/updater
22+
steps:
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: reviewdog/action-golangci-lint@f9bba13753278f6a73b27a56a3ffb1bfda90ed71 # v2.8.0
25+
with:
26+
filter_mode: nofilter
27+
fail_level: any
28+
workdir: ./${{matrix.modules}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Markdownlint
3+
permissions:
4+
contents: read
5+
on:
6+
pull_request:
7+
merge_group:
8+
jobs:
9+
markdownlint:
10+
runs-on: ubuntu-24.04
11+
permissions:
12+
contents: read
13+
statuses: write
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: reviewdog/action-markdownlint@3667398db9118d7e78f7a63d10e26ce454ba5f58 # v0.26.2
17+
with:
18+
fail_level: any
19+
filter_mode: nofilter

.github/workflows/pr-yamllint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Yamllint
3+
permissions:
4+
contents: read
5+
on:
6+
pull_request:
7+
merge_group:
8+
jobs:
9+
yamllint:
10+
runs-on: ubuntu-24.04
11+
permissions:
12+
contents: read
13+
statuses: write
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: reviewdog/action-yamllint@f01d8a48fd8d89f89895499fca2cff09f9e9e8c0 # v1.21.0
17+
with:
18+
fail_level: any
19+
filter_mode: nofilter

.github/workflows/push-release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
issues: write
14+
15+
jobs:
16+
versioning:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
new_release: ${{ steps.set-outputs.outputs.new_release }}
20+
tag_name: ${{ steps.set-outputs.outputs.tag_name }}
21+
steps:
22+
- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
23+
id: app_token
24+
with:
25+
app-id: ${{ secrets.APP_ID }}
26+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
27+
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
fetch-depth: 0
31+
token: ${{ steps.app_token.outputs.token }}
32+
33+
- uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4.2.0
34+
id: rp
35+
with:
36+
release-type: go
37+
token: ${{ steps.app_token.outputs.token }}
38+
39+
- name: Set outputs
40+
id: set-outputs
41+
run: |
42+
{
43+
echo "new_release=${{ steps.rp.outputs.release_created }}";
44+
echo "tag_name=${{ steps.rp.outputs.tag_name }}";
45+
} >> "$GITHUB_OUTPUT"
46+
47+
release:
48+
name: Create Release
49+
needs: versioning
50+
if: ${{ needs.versioning.outputs.new_release == 'true' }}
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
54+
id: app_token
55+
with:
56+
app-id: ${{ secrets.APP_ID }}
57+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
58+
59+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60+
with:
61+
fetch-depth: 0
62+
ref: ${{ needs.versioning.outputs.tag_name }}
63+
token: ${{ steps.app_token.outputs.token }}
64+
65+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
66+
with:
67+
go-version: '1.24.3'
68+
69+
- name: Run GoReleaser
70+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
71+
with:
72+
distribution: goreleaser
73+
version: v2.9.0
74+
args: release --clean
75+
env:
76+
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.dll
4+
*.so
5+
*.dylib
6+
7+
# Test binary, build output
8+
*.out
9+
*.test
10+
11+
# Go workspace files
12+
*.log
13+
*.tmp
14+
15+
# Dependency directories
16+
vendor/
17+
18+
# IDE/editor specific files
19+
.vscode/
20+
.idea/
21+
*.swp
22+
23+
# OS generated files
24+
.DS_Store
25+
Thumbs.db

.goreleaser.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
version: 2
3+
4+
before:
5+
hooks:
6+
- go mod tidy
7+
8+
builds:
9+
- env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- windows
14+
- darwin
15+
goarch:
16+
- amd64
17+
- arm64
18+
main: ./cmd/github-actions-digest-pinner/main.go
19+
binary: github-actions-digest-pinner
20+
ldflags:
21+
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{ .CommitDate }}
22+
23+
archives:
24+
- formats: ["tar.gz"]
25+
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"
26+
27+
checksum:
28+
name_template: 'checksums.txt'
29+
30+
release:
31+
draft: false
32+
prerelease: false

0 commit comments

Comments
 (0)