Skip to content

Commit 1e579f8

Browse files
committed
ci: github: Pin actions with sha as version
This practice prevent actions tags to be replaced (potenially maliciously) Note 2 spaces are added before comments to pass yamlint, please keep this consistant for machine parsing. Origin: #103 Relate-to: #67 Relate-to: https://c.s.c/x/fra7Jg Signed-off-by: Philippe Coval <[email protected]>
1 parent 517fe0e commit 1e579f8

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

.github/workflows/build-rootfs.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
- arm64
1717
# - armhf # TODO Enable when supported
1818
steps:
19-
- uses: actions/[email protected]
19+
# yamllint disable-line rule:line-length
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2021
with:
2122
fetch-depth: 0
2223
# Relate-to: https://github.com/actions/checkout/pull/2081#2025
@@ -34,7 +35,8 @@ jobs:
3435
UNIFYSDK_GIT_TAG=${{ secrets.UNIFYSDK_GIT_TAG }}
3536
./scripts/build-rootfs.sh
3637
- name: Upload artifacts
37-
uses: actions/upload-artifact@v4
38+
# yamllint disable-line rule:line-length
39+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3840
with:
3941
# yamllint disable-line rule:line-length
4042
name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }}-${{ matrix.arch }}
@@ -47,8 +49,10 @@ jobs:
4749
id: upload-release-asset
4850
env:
4951
token-defined: ${{ secrets.GH_UNIFY_ACCESS_TOKEN != '' }}
52+
# yamllint disable-line rule:line-length
5053
if: ${{ env.token-defined == true && startsWith(github.ref, 'refs/tags/') }}
51-
uses: softprops/action-gh-release@v2
54+
# yamllint disable-line rule:line-length
55+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
5256
with:
5357
files: build/dist/*
5458
# yamllint disable-line rule:line-length
@@ -57,7 +61,8 @@ jobs:
5761
- name: Upload pages artifact
5862
id: deployment
5963
if: startsWith(github.ref, 'refs/tags/') && matrix.arch == 'amd64'
60-
uses: actions/[email protected]
64+
# yamllint disable-line rule:line-length
65+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
6166
with:
6267
path: docs/
6368
deploy:
@@ -72,5 +77,6 @@ jobs:
7277
steps:
7378
- name: Deploy to GitHub Pages
7479
id: deployment
75-
uses: actions/deploy-pages@v4
80+
# yamllint disable-line rule:line-length
81+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
7682
if: startsWith(github.ref, 'refs/tags/')

.github/workflows/build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
project-name: z-wave-protocol-controller # Align to docker (lowercase)
1515
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: actions/[email protected]
17+
# yamllint disable-line rule:line-length
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1819
with:
1920
fetch-depth: 0
2021
- id: describe
@@ -37,7 +38,8 @@ jobs:
3738
df -h
3839
3940
- name: Upload container image
40-
uses: ishworkh/[email protected]
41+
# yamllint disable-line rule:line-length
42+
uses: ishworkh/container-image-artifact-upload@5d71a2417f0576fa11fe770fb04ece58c4587714 # v2.0.0
4143
with:
4244
image: "${{ env.project-name }}:latest"
4345
retention_days: 10
@@ -48,7 +50,8 @@ jobs:
4850
&& docker cp
4951
${container}:/usr/local/opt/${{ env.project-name }}/dist .
5052
- name: Upload artifacts
51-
uses: actions/upload-artifact@v4
53+
# yamllint disable-line rule:line-length
54+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5255
with:
5356
# yamllint disable-line
5457
name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }}

.github/workflows/test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,23 @@ jobs:
2222
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2323
steps:
2424
- name: Download image
25-
uses: ishworkh/[email protected]
25+
# yamllint disable-line rule:line-length
26+
uses: ishworkh/container-image-artifact-download@ccb3671db007622e886a2d7037eb62b119d5ffaf # v2.0.0
2627
with:
2728
image: "${{ env.project-name }}:latest"
2829
workflow: "build"
2930
token: ${{ secrets.GH_SL_ACCESS_TOKEN }}
3031
workflow_run_id: ${{ github.event.workflow_run.id }}
3132

32-
- uses: actions/[email protected]
33+
# yamllint disable-line rule:line-length
34+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3335
with:
3436
fetch-depth: 0
3537
ref: ${{ github.event.workflow_run.head_commit.id }}
3638

3739
- name: Download embedded applications package
38-
uses: robinraju/[email protected]
40+
# yamllint disable-line rule:line-length
41+
uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
3942
with:
4043
repository: 'Z-Wave-Alliance/z-wave-stack-binaries'
4144
tag: 'v25.1.0-28-g7e0b50f'
@@ -74,7 +77,8 @@ jobs:
7477
continue-on-error: true
7578

7679
- name: Propagate run status to commit status
77-
uses: actions/github-script@v7
80+
# yamllint disable-line rule:line-length
81+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
7882
if: always()
7983
env:
8084
status: ${{ steps.run.outcome }}

0 commit comments

Comments
 (0)