File tree Expand file tree Collapse file tree 16 files changed +182
-72
lines changed Expand file tree Collapse file tree 16 files changed +182
-72
lines changed Original file line number Diff line number Diff line change
1
+ name : " Actionlint"
2
+ description : " Lint GitHub Actions workflows"
3
+
4
+ runs :
5
+ using : " composite"
6
+ steps :
7
+ - name : Download actionlint
8
+ id : get_actionlint
9
+ run : bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
10
+ shell : bash
11
+ - name : Check workflow files
12
+ run : ${{ steps.get_actionlint.outputs.executable }} -color
13
+ shell : bash
Original file line number Diff line number Diff line change
1
+ name : " Checkout"
2
+ description : " Checkout repository code"
3
+
4
+ inputs :
5
+ fetch-depth :
6
+ description : " Number of commits to fetch"
7
+ required : false
8
+ default : " 1"
9
+
10
+ runs :
11
+ using : " composite"
12
+ steps :
13
+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
14
+ with :
15
+ fetch-depth : ${{ inputs.fetch-depth }}
Original file line number Diff line number Diff line change
1
+ name : " Clean Cache"
2
+ description : " Clean GitHub Actions cache for a PR branch"
3
+
4
+ runs :
5
+ using : " composite"
6
+ steps :
7
+ - name : Clean cache
8
+ run : |
9
+ echo "Fetching list of cache key"
10
+ cacheKeysForPR=$(gh cache list --ref "$BRANCH" --limit 100 --json id --jq '.[].id')
11
+
12
+ ## Setting this to not fail the workflow while deleting cache keys.
13
+ set +e
14
+ echo "Deleting caches..."
15
+ for cacheKey in $cacheKeysForPR
16
+ do
17
+ gh cache delete "$cacheKey"
18
+ done
19
+ echo "Done"
20
+ shell : bash
21
+ env :
22
+ GH_TOKEN : ${{ inputs.gh-token }}
23
+ GH_REPO : ${{ inputs.gh-repo }}
24
+ BRANCH : ${{ inputs.branch }}
Original file line number Diff line number Diff line change
1
+ name : " Docker Login"
2
+ description : " Login to Docker registries"
3
+
4
+ runs :
5
+ using : " composite"
6
+ steps :
7
+ - name : Login to Docker Hub
8
+ uses : docker/login-action@5b7b28b1cc417bbd34cd8c225a957c9ce9adf7f2
9
+ with :
10
+ username : ${{ inputs.dockerhub-username }}
11
+ password : ${{ inputs.dockerhub-token }}
12
+ - name : Login to GHCR
13
+ uses : docker/login-action@5b7b28b1cc417bbd34cd8c225a957c9ce9adf7f2
14
+ with :
15
+ registry : ghcr.io
16
+ username : ${{ inputs.ghcr-username }}
17
+ password : ${{ inputs.ghcr-token }}
18
+
19
+ inputs :
20
+ dockerhub-username :
21
+ description : " Docker Hub username"
22
+ required : true
23
+ dockerhub-token :
24
+ description : " Docker Hub token"
25
+ required : true
26
+ ghcr-username :
27
+ description : " GHCR username"
28
+ required : true
29
+ ghcr-token :
30
+ description : " GHCR token"
31
+ required : true
Original file line number Diff line number Diff line change
1
+ name : " Golang Security Checker"
2
+ description : " Run Gosec security scanner and upload SARIF report"
3
+
4
+ runs :
5
+ using : " composite"
6
+ steps :
7
+ - name : Checkout Source
8
+ uses : ./.github/actions/checkout
9
+ - name : Run Gosec Security Scanner
10
+ uses : securego/gosec@506407e7dfe6979d514d362f0b2d2ea77f49f5c8
11
+ with :
12
+ args : " -no-fail -fmt sarif -out results.sarif -tests ./..."
13
+ - name : Upload SARIF file
14
+ uses : github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3
15
+ with :
16
+ sarif_file : results.sarif
Original file line number Diff line number Diff line change
1
+ name : " govulncheck"
2
+ description : " Run govulncheck vulnerability scanner and upload SARIF report"
3
+
4
+ inputs :
5
+ go-version :
6
+ description : " Go version to use"
7
+ required : false
8
+ default : " 1.25.x"
9
+
10
+ runs :
11
+ using : " composite"
12
+ steps :
13
+ - id : govulncheck
14
+ uses : nicholas-fedor/govulncheck-action@1e9ef2cbd93abefcc8605e05f8c212aa90181f6f
15
+ with :
16
+ output-format : sarif
17
+ output-file : results.sarif
18
+ go-version-input : ${{ inputs.go-version }}
19
+ - name : Upload SARIF file
20
+ uses : github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3
21
+ with :
22
+ sarif_file : results.sarif
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ jobs:
105
105
with :
106
106
name : ${{ inputs.build-type }}-binary-sboms
107
107
path : dist/*.sbom
108
- if-no-files-found : warn
108
+ if-no-files-found : ignore
109
109
110
110
- name : Generate artifact attestation # Generate attestations for prod builds.
111
111
if : ${{ !inputs.dry-run && inputs.build-type == 'prod' }}
Original file line number Diff line number Diff line change @@ -11,22 +11,11 @@ permissions:
11
11
12
12
jobs :
13
13
cleanup :
14
+ if : github.event.pull_request.merged
14
15
runs-on : ubuntu-latest
15
16
steps :
16
- - name : Cleanup
17
- run : |
18
- echo "Fetching list of cache key"
19
- cacheKeysForPR=$(gh cache list --ref "$BRANCH" --limit 100 --json id --jq '.[].id')
20
-
21
- ## Setting this to not fail the workflow while deleting cache keys.
22
- set +e
23
- echo "Deleting caches..."
24
- for cacheKey in $cacheKeysForPR
25
- do
26
- gh cache delete "$cacheKey"
27
- done
28
- echo "Done"
29
- env :
30
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31
- GH_REPO : ${{ github.repository }}
32
- BRANCH : refs/pull/${{ github.event.pull_request.number }}/merge
17
+ - uses : ./.github/actions/clean-cache
18
+ with :
19
+ gh-token : ${{ secrets.GITHUB_TOKEN }}
20
+ gh-repo : ${{ github.repository }}
21
+ branch : refs/pull/${{ github.event.pull_request.number }}/merge
Original file line number Diff line number Diff line change @@ -29,20 +29,13 @@ jobs:
29
29
uses : actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
30
30
with :
31
31
fetch-depth : 0
32
-
33
- - name : Login to Docker Hub
34
- uses : docker/login-action@5b7b28b1cc417bbd34cd8c225a957c9ce9adf7f2
35
- with :
36
- username : ${{ secrets.DOCKERHUB_USERNAME }}
37
- password : ${{ secrets.DOCKERHUB_TOKEN }}
38
-
39
- - name : Login to GHCR
40
- uses : docker/login-action@5b7b28b1cc417bbd34cd8c225a957c9ce9adf7f2
32
+ - name : Login to registries
33
+ uses : ./.github/actions/docker-login
41
34
with :
42
- registry : ghcr.io
43
- username : ${{ github.actor }}
44
- password : ${{ github.token }}
45
-
35
+ dockerhub-username : ${{ secrets.DOCKERHUB_USERNAME }}
36
+ dockerhub-token : ${{ secrets.DOCKERHUB_TOKEN }}
37
+ ghcr-username : ${{ github.actor }}
38
+ ghcr-token : ${{ github.token }}
46
39
- name : Create Docker manifests for dev
47
40
if : ${{ inputs.build-type == 'dev' }}
48
41
run : |
58
51
ghcr.io/nicholas-fedor/shoutrrr:armhf-dev \
59
52
ghcr.io/nicholas-fedor/shoutrrr:arm64v8-dev \
60
53
ghcr.io/nicholas-fedor/shoutrrr:riscv64-dev
61
-
62
54
- name : Create Docker manifests for prod
63
55
if : ${{ inputs.build-type == 'prod' }}
64
56
run : |
Original file line number Diff line number Diff line change 19
19
runs-on : ubuntu-latest
20
20
steps :
21
21
- name : Checkout
22
- uses : actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
23
-
24
- - name : Download actionlint
25
- id : get_actionlint
26
- run : bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
27
- shell : bash
28
-
29
- - name : Check workflow files
30
- run : ${{ steps.get_actionlint.outputs.executable }} -color
31
- shell : bash
22
+ uses : ./.github/actions/checkout
23
+ - name : Run actionlint
24
+ uses : ./.github/actions/actionlint
You can’t perform that action at this time.
0 commit comments