Skip to content

Commit 80d00b9

Browse files
Pin the actions to commits, and let Dependabot move them
`actions/checkout@v4` is a tag, and a tag is a pointer its owner can move. Whoever controls it controls what runs in CI — with a checkout of this repository, a composer install, and whatever secrets the job is given. `ramsey/composer-install@v3` is not even a tag: it is a branch, so its tip moves with every commit the maintainer makes, and `@v3` today and `@v3` tomorrow are not promised to be the same code. A commit hash is the one reference nobody can move out from under you. It costs automatic updates, so those go to Dependabot: a pull request per version, with the release notes, which is the same update decided by somebody rather than arriving unannounced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARqBYLxrHqevcVmxHkpJcZ
1 parent 5a9be45 commit 80d00b9

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
updates:
4+
# The actions are pinned to commits, which is the only form of pinning a tag cannot be moved
5+
# out from under. That leaves updating them a manual job, so it is given to somebody whose
6+
# job it is: a pull request per new version, with the release notes attached.
7+
- package-ecosystem: github-actions
8+
directory: /
9+
schedule:
10+
interval: weekly
11+
commit-message:
12+
prefix: CI

‎.github/workflows/tests.yml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
matrix:
1717
php: ['8.1', '8.2', '8.3', '8.4']
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
2020

21-
- uses: shivammathur/setup-php@v2
21+
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
2222
with:
2323
php-version: ${{ matrix.php }}
2424
coverage: none
2525

26-
- uses: ramsey/composer-install@v3
26+
- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # v3
2727

2828
- name: Unit tests
2929
run: vendor/bin/unit-tests
@@ -34,16 +34,16 @@ jobs:
3434
env:
3535
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3636
steps:
37-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
3838
with:
3939
fetch-depth: 0
4040

41-
- uses: shivammathur/setup-php@v2
41+
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
4242
with:
4343
php-version: '8.3'
4444
coverage: none
4545

46-
- uses: ramsey/composer-install@v3
46+
- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # v3
4747

4848
- name: Unit tests with coverage
4949
run: phpdbg -qrr vendor/bin/unit-tests
@@ -53,22 +53,22 @@ jobs:
5353
if: env.SONAR_TOKEN != ''
5454
# Reporting, not a gate: a token which has expired should not turn a green suite red.
5555
continue-on-error: true
56-
uses: SonarSource/sonarqube-scan-action@v5
56+
uses: SonarSource/sonarqube-scan-action@2f77a1ec69fb1d595b06f35ab27e97605bdef703 # v5
5757
env:
5858
SONAR_HOST_URL: https://sonarcloud.io
5959

6060
static-analysis:
6161
name: Static analysis
6262
runs-on: ubuntu-latest
6363
steps:
64-
- uses: actions/checkout@v4
64+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
6565

66-
- uses: shivammathur/setup-php@v2
66+
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
6767
with:
6868
php-version: '8.3'
6969
coverage: none
7070

71-
- uses: ramsey/composer-install@v3
71+
- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # v3
7272

7373
- name: PHPStan
7474
run: vendor/bin/phpstan analyse --no-progress

0 commit comments

Comments
 (0)