Skip to content

Commit c7983ef

Browse files
Use commit SHA with version comments for all workflow action references (#239)
Standardize all GitHub Actions workflow references to use commit SHAs with version comments instead of mutable tags, ensuring deterministic builds and supply chain security. ### Changes - **GitHub Actions**: Updated `actions/checkout`, `actions/download-artifact`, `actions/upload-artifact`, `actions/upload-pages-artifact`, `actions/configure-pages`, `actions/deploy-pages` to SHA references - **PSModule Actions**: Updated all PSModule actions (`Auto-Release`, `Document-PSModule`, `GitHub-Script`, `Build-PSModule`, `Install-PSModuleHelpers`, `Get-PesterCodeCoverage`, `Get-PesterTestResults`, `Invoke-ScriptAnalyzer`, `Test-PSModule`, `Invoke-Pester`, `Publish-PSModule`) to SHA references - **13 workflow files updated** in `.github/workflows/` ### Format ```yaml # Before uses: actions/checkout@v6 # After uses: actions/checkout@1af3b93 # v6.0.0 ``` Dependabot supports SHA references for automated update PRs. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>🩹 [Patch]: Use commit SHA with specific version comments for all workflow action references</issue_title> > <issue_description>### Describe the change > > Standardize all GitHub Actions workflow references in this repository so that every action uses a commit SHA, with a comment specifying the most specific version tag (e.g., `# v1.2.3`). > > Why: > - Ensures deterministic builds and protects against unexpected updates or supply chain attacks. > - Improves maintainability and readability by documenting the exact version in use. > > Examples: > **✅ Correct:** > ```yaml > - name: Checkout Code > uses: actions/checkout@1af3b93 # v1.2.3 > with: > persist-credentials: false > ``` > **❌ Incorrect:** > ```yaml > - name: Checkout Code > uses: actions/checkout@v1 > ``` > Scope of change: > - Update all workflow files in `.github/workflows/*. yml` to reference actions by SHA with a version comment, instead of by tag. > - Use the most specific version tag in comments (e.g., `v1.2.3` instead of `v1`). > - Affected actions may include but are not limited to: `actions/checkout`, `actions/download-artifact`, `actions/upload-artifact`, `actions/configure-pages`, `actions/deploy-pages`, custom PSModule actions, etc. > - Ensure CI and linting checks do not break. > - Document changes in affected files. > > Security Note: > Dependabot is configured to notify and create PRs when upstream actions/workflows update. Dependabot supports SHA references, so using them does not reduce security or update capabilities. > > Acceptance: > - [ ] All workflows use commit SHA with a version comment specifying the most specific tag > - [ ] No workflows reference actions by tag (e.g., `@v1`) > - [ ] All CI/CD checks pass > - [ ] Documentation is updated as needed</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes #238 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/PSModule/Process-PSModule/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
1 parent ec60469 commit c7983ef

13 files changed

+43
-43
lines changed

.github/workflows/Auto-Release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Checkout Code
29-
uses: actions/checkout@v6
29+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3030

3131
- name: Auto-Release
32-
uses: PSModule/Auto-Release@v1
32+
uses: PSModule/Auto-Release@eabd533035e2cb9822160f26f2eda584bd012356 # v1.9.5
3333
with:
3434
IncrementalPrerelease: false

.github/workflows/Build-Docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,33 +48,33 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Checkout Code
51-
uses: actions/checkout@v6
51+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5252
with:
5353
persist-credentials: false
5454
fetch-depth: 0
5555

5656
- name: Download module artifact
57-
uses: actions/download-artifact@v6
57+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
5858
with:
5959
name: module
6060
path: ${{ inputs.WorkingDirectory }}/outputs/module
6161

6262
- name: Document module
63-
uses: PSModule/Document-PSModule@v1
63+
uses: PSModule/Document-PSModule@7e50d9f41753417346ff75b3601a90524aa8ab7e # v1.0.11
6464
with:
6565
Name: ${{ inputs.Name }}
6666
WorkingDirectory: ${{ inputs.WorkingDirectory }}
6767

6868
- name: Upload docs artifact
69-
uses: actions/upload-artifact@v5
69+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
7070
with:
7171
name: docs
7272
path: ${{ inputs.WorkingDirectory }}/outputs/docs
7373
if-no-files-found: error
7474
retention-days: 1
7575

7676
- name: Commit all changes
77-
uses: PSModule/GitHub-Script@v1
77+
uses: PSModule/GitHub-Script@00547bff5a143fbfc23a912a783fbfe9c470815c # v1.7.4
7878
with:
7979
Debug: ${{ inputs.Debug }}
8080
Prerelease: ${{ inputs.Prerelease }}

.github/workflows/Build-Module.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
GH_TOKEN: ${{ github.token }}
3030
steps:
3131
- name: Checkout Code
32-
uses: actions/checkout@v6
32+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3333
with:
3434
persist-credentials: false
3535
fetch-depth: 0
3636

3737
- name: Build module
38-
uses: PSModule/Build-PSModule@v4
38+
uses: PSModule/Build-PSModule@fe8cc14a7192066cc46cb9514659772ebde05849 # v4.0.9
3939
with:
4040
Name: ${{ inputs.Name }}
4141
ArtifactName: ${{ inputs.ArtifactName }}

.github/workflows/Build-Site.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout Code
45-
uses: actions/checkout@v6
45+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4646
with:
4747
persist-credentials: false
4848
fetch-depth: 0
4949

5050
- name: Install-PSModuleHelpers
51-
uses: PSModule/Install-PSModuleHelpers@v1
51+
uses: PSModule/Install-PSModuleHelpers@e05e9875aafc0a1e63fc13989b3b683a7ef6444f # v1.0.5
5252

5353
- name: Download docs artifact
54-
uses: actions/download-artifact@v6
54+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
5555
with:
5656
name: docs
5757
path: ${{ inputs.WorkingDirectory }}/outputs/docs
@@ -65,7 +65,7 @@ jobs:
6565
pip install mkdocs-git-committers-plugin-2
6666
6767
- name: Structure site
68-
uses: PSModule/GitHub-Script@v1
68+
uses: PSModule/GitHub-Script@00547bff5a143fbfc23a912a783fbfe9c470815c # v1.7.4
6969
with:
7070
Debug: ${{ inputs.Debug }}
7171
Prerelease: ${{ inputs.Prerelease }}
@@ -173,7 +173,7 @@ jobs:
173173
mkdocs build --config-file mkdocs.yml --site-dir ../../_site
174174
}
175175
176-
- uses: actions/upload-pages-artifact@v4
176+
- uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
177177
with:
178178
name: github-pages
179179
path: ${{ inputs.WorkingDirectory }}/_site

.github/workflows/Get-CodeCoverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Get-CodeCoverage
51-
uses: PSModule/Get-PesterCodeCoverage@v1
51+
uses: PSModule/Get-PesterCodeCoverage@a7923eefbf55b452f9b1534c5b50ca9bd192f810 # v1.0.3
5252
id: Get-CodeCoverage
5353
with:
5454
CodeCoveragePercentTarget: ${{ inputs.CodeCoveragePercentTarget }}

.github/workflows/Get-Settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ jobs:
6565
ModuleTestSuites: ${{ fromJson(steps.Get-Settings.outputs.result).ModuleTestSuites }}
6666
steps:
6767
- name: Checkout Code
68-
uses: actions/checkout@v6
68+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
6969
with:
7070
persist-credentials: false
7171
fetch-depth: 0
7272

7373
- name: Get-Settings
74-
uses: PSModule/GitHub-Script@v1
74+
uses: PSModule/GitHub-Script@00547bff5a143fbfc23a912a783fbfe9c470815c # v1.7.4
7575
id: Get-Settings
7676
env:
7777
PSMODULE_GET_SETTINGS_INPUT_Name: ${{ inputs.Name }}

.github/workflows/Get-TestResults.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
runs-on: ubuntu-latest
5151
steps:
5252
- name: Get-TestResults
53-
uses: PSModule/Get-PesterTestResults@v1
53+
uses: PSModule/Get-PesterTestResults@0c1d8cde9575b192831f76e87d3f7e825a7d8ff4 # v1.0.7
5454
id: Get-TestResults
5555
with:
5656
SourceCodeTestSuites: ${{ inputs.SourceCodeTestSuites }}

.github/workflows/Lint-SourceCode.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ jobs:
5050
runs-on: ${{ inputs.RunsOn }}
5151
steps:
5252
- name: Checkout Code
53-
uses: actions/checkout@v6
53+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5454
with:
5555
persist-credentials: false
5656

5757
- name: Lint-SourceCode
58-
uses: PSModule/Invoke-ScriptAnalyzer@v4
58+
uses: PSModule/Invoke-ScriptAnalyzer@0b13023a981f4c94136bba6193a9abd2d936cbc1 # v4.1.1
5959
with:
6060
Debug: ${{ inputs.Debug }}
6161
Prerelease: ${{ inputs.Prerelease }}

.github/workflows/Linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout repo
22-
uses: actions/checkout@v6
22+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2323
with:
2424
persist-credentials: false
2525
fetch-depth: 0

.github/workflows/Test-Module.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ jobs:
8181
runs-on: ${{ inputs.RunsOn }}
8282
steps:
8383
- name: Checkout repository
84-
uses: actions/checkout@v6
84+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
8585
with:
8686
persist-credentials: false
8787

8888
- name: Download module artifact
89-
uses: actions/download-artifact@v6
89+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
9090
with:
9191
name: module
9292
path: ${{ inputs.WorkingDirectory }}/outputs/module
9393

9494
- name: Test-Module
95-
uses: PSModule/Test-PSModule@v3
95+
uses: PSModule/Test-PSModule@80b0364db8192e73f584603c68a127de171f881f # v3.0.6
9696
with:
9797
Name: ${{ inputs.Name }}
9898
Debug: ${{ inputs.Debug }}
@@ -107,18 +107,18 @@ jobs:
107107
runs-on: ${{ inputs.RunsOn }}
108108
steps:
109109
- name: Checkout repository
110-
uses: actions/checkout@v6
110+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
111111
with:
112112
persist-credentials: false
113113

114114
- name: Download module artifact
115-
uses: actions/download-artifact@v6
115+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
116116
with:
117117
name: module
118118
path: ${{ inputs.WorkingDirectory }}/outputs/module
119119

120120
- name: Lint-Module
121-
uses: PSModule/Invoke-ScriptAnalyzer@v4
121+
uses: PSModule/Invoke-ScriptAnalyzer@0b13023a981f4c94136bba6193a9abd2d936cbc1 # v4.1.1
122122
with:
123123
Path: outputs/module
124124
Debug: ${{ inputs.Debug }}

0 commit comments

Comments
 (0)