Skip to content

Commit 7ffc25a

Browse files
committed
Harden CI supply chain and trim the dist archive
Pin all GitHub Actions to full commit SHAs so workflow runs cannot be altered by a moved tag, add a Dependabot config to keep those pins (plus Composer and docs npm dependencies) current, and add a .gitattributes with export-ignore so development-only paths stay out of the package archive Composer installs.
1 parent cfe587a commit 7ffc25a

4 files changed

Lines changed: 72 additions & 6 deletions

File tree

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto eol=lf
2+
3+
# Development-only paths, excluded from the dist archive that Composer installs.
4+
/.github export-ignore
5+
/art export-ignore
6+
/docs export-ignore
7+
/tests export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/.gitattributes export-ignore
10+
/.gitignore export-ignore

.github/dependabot.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version: 2
2+
3+
updates:
4+
# Keep workflow actions up to date. Dependabot rewrites the pinned SHA and
5+
# the trailing version comment together, so pinning stays maintainable.
6+
- package-ecosystem: github-actions
7+
directory: "/"
8+
schedule:
9+
interval: weekly
10+
day: monday
11+
cooldown:
12+
default-days: 7
13+
semver-major-days: 30
14+
semver-minor-days: 7
15+
semver-patch-days: 3
16+
groups:
17+
github-actions:
18+
patterns: ["*"]
19+
labels:
20+
- dependencies
21+
- github-actions
22+
23+
- package-ecosystem: composer
24+
directory: "/"
25+
schedule:
26+
interval: weekly
27+
day: monday
28+
cooldown:
29+
default-days: 7
30+
semver-major-days: 30
31+
semver-minor-days: 7
32+
semver-patch-days: 3
33+
groups:
34+
php-dev-dependencies:
35+
dependency-type: development
36+
patterns: ["*"]
37+
labels:
38+
- dependencies
39+
- php
40+
41+
- package-ecosystem: npm
42+
directory: "/docs"
43+
schedule:
44+
interval: weekly
45+
day: monday
46+
cooldown:
47+
default-days: 7
48+
semver-major-days: 30
49+
semver-minor-days: 7
50+
semver-patch-days: 3
51+
groups:
52+
docs-dependencies:
53+
patterns: ["*"]
54+
labels:
55+
- dependencies
56+
- docs

.github/workflows/deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ jobs:
5353
esac
5454
5555
- name: Checkout source branch
56-
uses: actions/checkout@v6
56+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
5757
with:
5858
ref: ${{ steps.version.outputs.branch }}
5959

6060
- name: Checkout gh-pages
61-
uses: actions/checkout@v6
61+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
6262
with:
6363
ref: gh-pages
6464
path: gh-pages
6565

6666
- name: Setup Node.js
67-
uses: actions/setup-node@v6
67+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
6868
with:
6969
node-version: '20'
7070
cache: 'npm'

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121

2222
steps:
2323
- name: Checkout code
24-
uses: actions/checkout@v6
24+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
2525

2626
- name: Setup PHP
27-
uses: shivammathur/setup-php@v2
27+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
2828
with:
2929
php-version: ${{ matrix.php }}
3030
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, fileinfo
@@ -35,7 +35,7 @@ jobs:
3535
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3636

3737
- name: Cache composer dependencies
38-
uses: actions/cache@v4
38+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
3939
with:
4040
path: ${{ steps.composer-cache.outputs.dir }}
4141
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.stability }}-${{ hashFiles('**/composer.json') }}

0 commit comments

Comments
 (0)