Skip to content

Commit 120af70

Browse files
authored
CI: Improve GitHub Actions security (#24)
* ci: add dependabot config for github-actions * ci: update github actions to their latest version and pin them to sha to prevent github action supply-chain attacks.
1 parent e41ed1a commit 120af70

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ updates:
88
directory: "/src/PSTui.Models/"
99
schedule:
1010
interval: weekly
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"

‎.github/workflows/ci-test.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2424

2525
- name: Install dotnet
26-
uses: actions/setup-dotnet@v4
26+
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
2727
with:
2828
global-json-file: global.json
2929
cache: true
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: Upload module
6262
if: always()
63-
uses: actions/upload-artifact@v4
63+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6464
with:
6565
name: PSTui-module-${{ matrix.os }}
6666
path: module

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ jobs:
5050
prerelease: ${{ steps.version.outputs.prerelease }}
5151
steps:
5252
- name: Checkout repository
53-
uses: actions/checkout@v4
53+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5454
with:
5555
fetch-depth: 0 # need full tag history for version resolution
5656

5757
- name: Install dotnet
58-
uses: actions/setup-dotnet@v4
58+
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
5959
with:
6060
cache: true
6161
cache-dependency-path: '**/*.csproj' # SDK version comes from global.json
@@ -177,7 +177,7 @@ jobs:
177177

178178
- name: Tag and create GitHub Release
179179
if: env.HAS_PSGALLERY_KEY == 'true' && github.ref == 'refs/heads/main'
180-
uses: softprops/action-gh-release@v2
180+
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
181181
with:
182182
tag_name: v${{ steps.version.outputs.version }}
183183
prerelease: ${{ steps.version.outputs.prerelease == 'true' }}
@@ -186,7 +186,7 @@ jobs:
186186

187187
- name: Upload artifact (always)
188188
if: always()
189-
uses: actions/upload-artifact@v4
189+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
190190
with:
191191
name: PSTui-${{ steps.version.outputs.version }}
192192
path: module
@@ -199,7 +199,7 @@ jobs:
199199
issues: write
200200
steps:
201201
- name: Open or update failure issue
202-
uses: actions/github-script@v7
202+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
203203
with:
204204
script: |
205205
const title = 'Release workflow failed';

0 commit comments

Comments
 (0)