Skip to content

Commit 8df5ca3

Browse files
committed
chore: pin actions to SHA hash
I'd prefer to have immutable releases, but they're not out yet... seems this is the second best option. See https://github.blog/news-insights/product-news/whats-coming-to-our-github-actions-2026-security-roadmap/.
1 parent 45df49c commit 8df5ca3

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

.github/workflows/lint.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: SwiftLint
22

3-
on:
4-
[push, pull_request]
3+
on: [ push, pull_request ]
54

65
permissions:
76
contents: read
@@ -12,8 +11,11 @@ jobs:
1211
runs-on: ubuntu-latest
1312

1413
steps:
15-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
15+
with:
16+
persist-credentials: false
1617
- name: SwiftLint
17-
uses: norio-nomura/action-swiftlint@3.2.1
18+
uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684
19+
# using @3.2.1
1820
with:
1921
args: --strict

.github/workflows/main.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Main
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request ]
44

55
permissions:
66
contents: read
@@ -19,21 +19,24 @@ jobs:
1919
- platform: iOS
2020
scheme: "SWXMLHash iOS"
2121
action: "build-for-testing test-without-building"
22-
sdk-and-dest: '-sdk iphonesimulator -destination "OS=17.2,name=iPhone 15"'
22+
sdk-and-dest: "-sdk iphonesimulator -destination \"OS=17.2,name=iPhone 15\""
2323

2424
- platform: tvOS
2525
scheme: "SWXMLHash tvOS"
26-
sdk-and-dest: '-sdk appletvsimulator -destination "name=Apple TV"'
26+
sdk-and-dest: "-sdk appletvsimulator -destination \"name=Apple TV\""
2727

2828
- platform: watchOS
2929
scheme: "SWXMLHash watchOS"
3030
action: "build-for-testing test-without-building"
3131
sdk-and-dest: "-sdk watchsimulator"
3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v6
35+
with:
36+
persist-credentials: false
3537

36-
- uses: maxim-lobanov/setup-xcode@v1
38+
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90
39+
# using @v1
3740
with:
3841
xcode-version: "16.2"
3942

@@ -42,7 +45,6 @@ jobs:
4245
WORKSPACE: "-workspace SWXMLHash.xcworkspace"
4346
run: |
4447
xcodebuild ${{ matrix.action }} $WORKSPACE -scheme ${{ matrix.scheme }} ${{ matrix.sdk-and-dest }} | xcpretty
45-
4648
# TODO: I'd like to use this action instead of the above xcodebuild command, but I'm getting a destination error:
4749
# xcodebuild: error: Unable to find a destination matching the provided destination specifier:
4850
# { id:D918798E-6DEE-48F7-850A-A4C0D9328F0A }
@@ -99,7 +101,9 @@ jobs:
99101
timeout-minutes: 10
100102
steps:
101103
- name: Checkout
102-
uses: actions/checkout@v4
104+
uses: actions/checkout@v6
105+
with:
106+
persist-credentials: false
103107
- name: Build
104108
if: ${{ matrix.skip-testing }}
105109
run: |
@@ -124,13 +128,16 @@ jobs:
124128

125129
steps:
126130
- name: Install Swift
127-
uses: compnerd/gha-setup-swift@main
131+
uses: compnerd/gha-setup-swift@eeda069c5bc95ac8a9ac5cea7d4f588ae5420ca5
132+
# using @main
128133
with:
129134
branch: ${{ matrix.branch}}
130135
tag: ${{ matrix.tag }}
131136

132137
- name: Checkout
133-
uses: actions/checkout@v4
138+
uses: actions/checkout@v6
139+
with:
140+
persist-credentials: false
134141
- name: Build
135142
if: ${{ matrix.skip-testing }}
136143
run: |

0 commit comments

Comments
 (0)