Skip to content

Commit c47ba08

Browse files
committed
ENH: Pin GitHub actions to full length commit SHA
GitHub's security hardening guide recommends this mitigation method. https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
1 parent 0a81afb commit c47ba08

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.github/workflows/commit-message.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Check Commit Prefix
22-
uses: gsactions/commit-message-checker@v2
22+
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee # v2.0.0
2323
with:
2424
pattern: "^(ENH|PERF|BUG|STYLE|DOC|COMP): ([A-Z])+"
2525
flags: "gm"
@@ -29,7 +29,7 @@ jobs:
2929
checkAllCommitMessages: "true" # optional: this checks all commits associated with a pull request
3030
accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true
3131
- name: Check Line Length
32-
uses: gsactions/commit-message-checker@v2
32+
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee # v2.0.0
3333
with:
3434
pattern: "^[^#].{1,78}$"
3535
error: "The maximum line length of 78 characters is exceeded. For more details, see https://slicer.readthedocs.io/en/latest/developer_guide/style_guide.html#commits"

.github/workflows/lint.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
pre-commit:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1919

20-
- uses: actions/setup-python@v5
20+
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
2121

22-
- uses: pre-commit/[email protected]
22+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
2323

2424
pre-commit-cookie:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2828

2929
- run: pipx run nox -s 'pre-commit-cookie'

{{cookiecutter.project_name}}/.github/workflows/commit-message.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Check Commit Prefix
22-
uses: gsactions/commit-message-checker@v2
22+
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee # v2.0.0
2323
with:
2424
pattern: "^(ENH|PERF|BUG|STYLE|DOC|COMP): ([A-Z])+"
2525
flags: "gm"
@@ -29,7 +29,7 @@ jobs:
2929
checkAllCommitMessages: "true" # optional: this checks all commits associated with a pull request
3030
accessToken: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} # github access token is only required if checkAllCommitMessages is true
3131
- name: Check Line Length
32-
uses: gsactions/commit-message-checker@v2
32+
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee # v2.0.0
3333
with:
3434
pattern: "^[^#].{1,78}$"
3535
error: "The maximum line length of 78 characters is exceeded. For more details, see https://slicer.readthedocs.io/en/latest/developer_guide/style_guide.html#commits"

{{cookiecutter.project_name}}/.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
pre-commit:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1919

20-
- uses: actions/setup-python@v5
20+
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
2121
with:
2222
python-version: "3.9"
2323

24-
- uses: pre-commit/[email protected]
24+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

0 commit comments

Comments
 (0)