Skip to content

Commit a6cf55d

Browse files
committed
workflows: use explicit SHA for all action references
Port the improvements from nvme-cli to libnvme. Signed-off-by: Daniel Wagner <[email protected]>
1 parent d65b44c commit a6cf55d

6 files changed

Lines changed: 37 additions & 37 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
container:
2020
image: ghcr.io/linux-nvme/debian.python:latest
2121
steps:
22-
- uses: actions/checkout@v5
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
- name: build
2424
run: |
2525
scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} -x
26-
- uses: actions/upload-artifact@v5
26+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
2727
name: upload logs
2828
if: failure()
2929
with:
@@ -40,26 +40,24 @@ jobs:
4040
- arch: s390x
4141
- arch: ppc64le
4242
steps:
43-
- uses: actions/checkout@v5
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444
- name: enable foreign arch
45-
uses: dbhi/qus/action@main
45+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
4646
- name: Login to GitHub Container Registry
47-
uses: docker/login-action@v3
47+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
4848
with:
4949
registry: ghcr.io
5050
username: ${{ github.actor }}
5151
password: ${{ secrets.GITHUB_TOKEN }}
5252
- name: compile and run unit tests
53-
uses: mosteo-actions/docker-run@v2
54-
with:
55-
image: ghcr.io/linux-nvme/ubuntu-cross-${{ matrix.arch }}:latest
56-
guest-dir: /build
57-
host-dir: ${{ github.workspace }}
58-
command: |
59-
scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross
60-
params: "--platform linux/amd64"
61-
pull-params: "--platform linux/amd64"
62-
- uses: actions/upload-artifact@v5
53+
run: |
54+
docker run --rm \
55+
--platform linux/amd64 \
56+
-v "${{ github.workspace }}:/build" \
57+
-w /build \
58+
ghcr.io/linux-nvme/ubuntu-cross-${{ matrix.arch }}:latest \
59+
sh -c "git config --global --add safe.directory /build && scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross"
60+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6361
name: upload logs
6462
if: failure()
6563
with:
@@ -73,11 +71,11 @@ jobs:
7371
container:
7472
image: ghcr.io/linux-nvme/debian:latest
7573
steps:
76-
- uses: actions/checkout@v5
74+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7775
- name: build
7876
run: |
7977
scripts/build.sh -b release -c gcc libdbus
80-
- uses: actions/upload-artifact@v5
78+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
8179
name: upload logs
8280
if: failure()
8381
with:
@@ -92,11 +90,11 @@ jobs:
9290
image: ghcr.io/linux-nvme/debian:latest
9391
if: github.ref == 'refs/heads/master'
9492
steps:
95-
- uses: actions/checkout@v5
93+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9694
- name: build
9795
run: |
9896
scripts/build.sh -b release -c gcc fallback
99-
- uses: actions/upload-artifact@v5
97+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
10098
if: failure()
10199
with:
102100
name: log files
@@ -109,7 +107,7 @@ jobs:
109107
container:
110108
image: ghcr.io/linux-nvme/debian:latest
111109
steps:
112-
- uses: actions/checkout@v5
110+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
113111
- name: build
114112
run: |
115113
scripts/build.sh -m muon

.github/workflows/checkpatch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ jobs:
77
steps:
88
- name: 'Calculate PR commits + 1'
99
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
10-
- uses: actions/checkout@v5
10+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1111
with:
1212
ref: ${{ github.event.pull_request.head.sha }}
1313
fetch-depth: 0
1414
- name: Run checkpatch review
15-
uses: webispy/checkpatch-action@v9
15+
uses: webispy/checkpatch-action@58374fe5bb03358b23d3d6871e2ff290ce77fcd2 # v9

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
container:
1515
image: ghcr.io/linux-nvme/debian.python:latest
1616
steps:
17-
- uses: actions/checkout@v5
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
- name: build
1919
run: |
2020
scripts/build.sh coverage
21-
- uses: codecov/codecov-action@v5
21+
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
2222
with:
2323
token: ${{ secrets.CODECOV_TOKEN }}
2424
fail_ci_if_error: true

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
container:
1717
image: ghcr.io/linux-nvme/debian:latest
1818
steps:
19-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020
- name: build
2121
run: |
2222
scripts/build.sh docs

.github/workflows/release-python.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
container:
2222
image: ghcr.io/linux-nvme/debian.python:latest
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525

2626
- name: Allow workspace
2727
run: |
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
pipx run twine check dist/*.tar.gz
3737
38-
- uses: actions/upload-artifact@v5
38+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
3939
with:
4040
path: dist/*.tar.gz
4141
retention-days: 5
@@ -49,7 +49,7 @@ jobs:
4949
image: ghcr.io/linux-nvme/debian.python:latest
5050
steps:
5151
- name: Check out repository (with tags)
52-
uses: actions/checkout@v5
52+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5353
with:
5454
fetch-depth: 0 # Required for `git describe`
5555

@@ -79,7 +79,7 @@ jobs:
7979
run: |
8080
pipx run twine check dist/*.tar.gz
8181
82-
- uses: actions/upload-artifact@v5
82+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
8383
with:
8484
name: test_pypi
8585
path: dist/*.tar.gz
@@ -95,13 +95,13 @@ jobs:
9595
id-token: write
9696
if: github.repository == 'linux-nvme/libnvme'
9797
steps:
98-
- uses: actions/download-artifact@v6
98+
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
9999
with:
100100
name: test_pypi
101101
path: dist
102102

103103
- name: Publish package to TestPyPI
104-
uses: pypa/gh-action-pypi-publish@v1.13.0
104+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
105105
with:
106106
repository-url: https://test.pypi.org/legacy/
107107

@@ -123,12 +123,12 @@ jobs:
123123
fi
124124
125125
- name: Download artifiact
126-
uses: actions/download-artifact@v6
126+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
127127
if: steps.check-tag.outputs.match == 'true'
128128
with:
129129
name: artifact
130130
path: dist
131131

132132
- name: Publish package to PyPI
133-
uses: pypa/gh-action-pypi-publish@v1.13.0
133+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
134134
if: steps.check-tag.outputs.match == 'true'

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
permissions:
1515
contents: write
1616
steps:
17-
- uses: actions/checkout@v5
18-
- uses: ncipollo/release-action@v1
19-
with:
20-
token: ${{ secrets.GITHUB_TOKEN }}
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
- name: Create Release
19+
run: |
20+
gh release create "${GITHUB_REF_NAME}" --generate-notes
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)