Skip to content

Commit c4aff8a

Browse files
Merge pull request #6595 from IntersectMBO/improve-gha
ci: improve github actions
2 parents 1276f22 + 54c79c4 commit c4aff8a

16 files changed

Lines changed: 136 additions & 92 deletions

.github/workflows/actionlint.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ jobs:
88
actionlint:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
12+
with:
13+
persist-credentials: false
1214

1315
# We want to install Nix to provision shellcheck, so that actionlint doesn't install
1416
# its own shellcheck. This will also make sure that this pipeline runs using
1517
# the same shellcheck as the ones in Nix shells of developers.
1618
- name: Install Nix
17-
uses: cachix/install-nix-action@v31
19+
uses: cachix/install-nix-action@b97f05dcb019ddea06450a50ef6203d2fdc19fee # v31
1820
with:
1921
extra_nix_config: |
20-
accept-flake-config = true
22+
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
23+
extra-substituters = https://cache.iog.io/
2124
# Make the Nix environment available to next steps
22-
- uses: rrbutani/use-nix-shell-action@v1
25+
- uses: rrbutani/use-nix-shell-action@f97339023a09121113e5a58ad88fe0e9fde3406b # v1
2326

2427
- name: actionlint
2528
run: |

.github/workflows/check-cabal-files.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ jobs:
1010

1111
steps:
1212
- name: Install Haskell
13-
uses: input-output-hk/actions/haskell@latest
13+
uses: input-output-hk/actions/haskell@dbb6ea6d50ffc37a2d481fd8047aff028bac3223 # latest
1414
id: setup-haskell
1515
with:
1616
cabal-version: "3.10.2.0"
1717

18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
19+
with:
20+
persist-credentials: false
1921

2022
- name: Cabal check
2123
run: ./scripts/ci/check-cabal-files.sh

.github/workflows/check-changelog.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ jobs:
1414
name: Check for scriv fragment
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
with:
19+
persist-credentials: false
1820

1921
- name: Check for changes in cardano-testnet
20-
uses: dorny/paths-filter@v3
22+
uses: dorny/paths-filter@6852f92c20ea7fd3b0c25de3b5112db3a98da050 # v3
2123
id: filter
2224
with:
2325
filters: |
@@ -26,22 +28,23 @@ jobs:
2628
2729
- name: Check for changelog changes
2830
if: steps.filter.outputs.cardano == 'true'
29-
uses: brettcannon/check-for-changed-files@v1
31+
uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1
3032
with:
3133
file-pattern: "cardano-testnet/changelog.d/*.md"
3234
skip-label: "no-changelog-needed"
3335
failure-message: "You modified `cardano-testnet` but are missing a changelog fragment! Please run `scriv create` or apply the `no-changelog-needed` label."
3436

3537
- name: Install Nix
3638
if: steps.filter.outputs.cardano == 'true'
37-
uses: cachix/install-nix-action@v31
39+
uses: cachix/install-nix-action@b97f05dcb019ddea06450a50ef6203d2fdc19fee # v31
3840
with:
3941
extra_nix_config: |
40-
accept-flake-config = true
42+
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
43+
extra-substituters = https://cache.iog.io/
4144
4245
- name: Check scriv fragments are correct
4346
if: steps.filter.outputs.cardano == 'true'
44-
uses: rrbutani/use-nix-shell-action@v1
47+
uses: rrbutani/use-nix-shell-action@f97339023a09121113e5a58ad88fe0e9fde3406b # v1
4548
with:
4649
script: cd cardano-testnet && scriv collect --version "CI-CHECK" --keep
4750

.github/workflows/check-git-dependencies.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414

1515
steps:
1616

17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
with:
19+
persist-credentials: false
1820

1921
- name: Check git dependencies
2022
run: |

.github/workflows/check-hlint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ jobs:
1414

1515
steps:
1616

17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
with:
19+
persist-credentials: false
1820

1921
- name: 'Set up HLint'
20-
uses: rwe/actions-hlint-setup@v1
22+
uses: rwe/actions-hlint-setup@9f5da5e7cd43663fb7b2e2154a087c17f0471ed1 # v1
2123
with:
2224
version: 3.8
2325

2426
- name: 'Run HLint'
25-
uses: rwe/actions-hlint-run@v2
27+
uses: rwe/actions-hlint-run@c178fa6263930e604e377a21ef54403306bdc1c7 # v2

.github/workflows/check-mainnet-config.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ jobs:
1515
steps:
1616

1717
- name: Install Nix
18-
uses: cachix/install-nix-action@v27
18+
uses: cachix/install-nix-action@b97f05dcb019ddea06450a50ef6203d2fdc19fee # v31
1919
with:
2020
# Use last stable nixos channel and the same nix as in channel:
2121
nix_path: nixpkgs=channel:nixos-24.05
2222
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2323
extra_nix_config: |
24-
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
2524
experimental-features = nix-command flakes
2625
allow-import-from-derivation = true
27-
substituters = https://cache.nixos.org https://cache.iog.io
28-
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
26+
extra-substituters = https://cache.iog.io/
27+
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
2928
30-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
30+
with:
31+
persist-credentials: false
3132

3233
- name: Refresh cardano-node mainnet configuration
3334
run: |

.github/workflows/github-page.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ jobs:
1515

1616
steps:
1717
- name: Install Nix
18-
uses: cachix/install-nix-action@v18
18+
uses: cachix/install-nix-action@b97f05dcb019ddea06450a50ef6203d2fdc19fee # v31
1919
with:
2020
# Use last stable nixos channel and the same nix as in channel:
2121
nix_path: nixpkgs=channel:nixos-24.05
2222
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2323
extra_nix_config: |
24-
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
2524
experimental-features = nix-command flakes
2625
allow-import-from-derivation = true
27-
substituters = https://cache.nixos.org https://cache.iog.io
28-
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
26+
extra-substituters = https://cache.iog.io/
27+
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
2928
30-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
30+
with:
31+
persist-credentials: false
3132

3233
- name: Fetch nix cache and update cabal indices
3334
run: |
@@ -49,7 +50,7 @@ jobs:
4950
tar -czf haddocks.tgz -C haddocks .
5051
5152
- name: Upload haddocks artifact
52-
uses: actions/upload-artifact@v4
53+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
5354
if: ${{ always() }}
5455
continue-on-error: true
5556
with:
@@ -58,7 +59,7 @@ jobs:
5859

5960
- name: Deploy documentation to gh-pages 🚀
6061
if: github.ref == 'refs/heads/master'
61-
uses: peaceiris/actions-gh-pages@v4
62+
uses: peaceiris/actions-gh-pages@e9c66a37f080288a11235e32cbe2dc5fb3a679cc # v4
6263
with:
6364
github_token: ${{ secrets.GITHUB_TOKEN || github.token }}
6465
publish_dir: haddocks

.github/workflows/haskell.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,26 @@ jobs:
8888
g+${{ (startsWith(github.ref, 'refs/heads/gh-readonly-queue/') && github.run_id) || github.event.pull_request.number || github.ref }}
8989
9090
- name: Install Haskell
91-
uses: input-output-hk/actions/haskell@latest
91+
uses: input-output-hk/actions/haskell@dbb6ea6d50ffc37a2d481fd8047aff028bac3223 # latest
9292
id: setup-haskell
9393
with:
9494
ghc-version: ${{ matrix.ghc }}
9595
cabal-version: ${{ matrix.cabal }}
9696

9797
- name: Install system dependencies
98-
uses: input-output-hk/actions/base@latest
98+
uses: input-output-hk/actions/base@dbb6ea6d50ffc37a2d481fd8047aff028bac3223 # latest
9999
with:
100100
use-sodium-vrf: true # default is true
101101

102102
- name: Install gRPC system dependencies
103-
uses: input-output-hk/cardano-dev/actions/grpc-deps@grpc-deps-0.0.1.0
103+
uses: input-output-hk/cardano-dev/actions/grpc-deps@64bbe67966d5ee404a795803a2b56718baebffb4 # grpc-deps-0.0.1.0
104104

105-
- uses: actions/checkout@v4
105+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
106+
with:
107+
persist-credentials: false
106108

107109
- name: Cache and install Cabal dependencies
108-
uses: input-output-hk/cardano-dev/actions/cabal-cache@cabal-cache-0.0.1.0
110+
uses: input-output-hk/cardano-dev/actions/cabal-cache@e811e25d3927d62ba87f1762ea51c36e65f0b09a # cabal-cache-0.0.1.0
109111
with:
110112
cabal-store: ${{ steps.setup-haskell.outputs.cabal-store }}
111113
cache-version: ${{ env.CABAL_CACHE_VERSION }}
@@ -132,7 +134,7 @@ jobs:
132134
133135
- name: Upload workspaces on tests failure
134136
if: ${{ failure() }}
135-
uses: actions/upload-artifact@v4
137+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
136138
with:
137139
name: failed-test-workspaces-${{ matrix.sys.os }}-ghc${{ matrix.ghc }}-cabal${{ matrix.cabal }}.tgz
138140
path: ${{ runner.temp }}/workspaces.tgz
@@ -161,7 +163,7 @@ jobs:
161163
fi
162164
163165
- name: Save Artifact
164-
uses: actions/upload-artifact@v4
166+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
165167
if: ${{ always() }}
166168
continue-on-error: true
167169
with:
@@ -206,7 +208,9 @@ jobs:
206208
runs-on: ubuntu-latest
207209
steps:
208210
- name: Checkout code
209-
uses: actions/checkout@v4
211+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
212+
with:
213+
persist-credentials: false
210214

211215
- name: Create Release Tag
212216
id: create_release_tag
@@ -215,7 +219,7 @@ jobs:
215219
216220
- name: Create Release
217221
id: create_release
218-
uses: actions/create-release@v1
222+
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
219223
env:
220224
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
221225
with:
@@ -225,12 +229,12 @@ jobs:
225229
prerelease: false
226230

227231
- name: Download Artifact
228-
uses: actions/download-artifact@v4
232+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
229233
with:
230234
name: artifacts-ubuntu-latest
231235

232236
- name: Upload Release Asset
233-
uses: actions/upload-release-asset@v1
237+
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1
234238
env:
235239
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
236240
with:

.github/workflows/markdown-links-ci-check.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ jobs:
88
markdown-link-check:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- uses: tcort/github-action-markdown-link-check@v1
11+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
12+
with:
13+
persist-credentials: false
14+
- uses: tcort/github-action-markdown-link-check@e7c7a18363c842693fadde5d41a3bd3573a7a225 # v1
1315
with:
1416
use-quiet-mode: yes
1517
config-file: '.github/mlc_config.json'

.github/workflows/nightly-trigger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717

18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1919

2020
- name: Tag
2121
run: |
@@ -24,7 +24,7 @@ jobs:
2424
git push origin nightly --force
2525
2626
- name: Invoke workflow
27-
uses: input-output-hk/workflow-dispatch@v1
27+
uses: input-output-hk/workflow-dispatch@be1256a3797d8bbe96bdbdf65dbf9cc8dc48e9eb # v1
2828
with:
2929
workflow: .github/workflows/haskell.yml
3030
ref: nightly

0 commit comments

Comments
 (0)