Skip to content

Commit db41e06

Browse files
authored
[6.x] Add codeowners and tripwire (#14744)
1 parent 00ec795 commit db41e06

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/composer.json @statamic/security
2+
/src/helpers.php @statamic/security
3+
/src/namespaced_helpers.php @statamic/security
4+
/src/View/Blade/helpers.php @statamic/security
5+
6+
/.github/CODEOWNERS @statamic/security
7+
/.github/workflows/tripwire.yml @statamic/security
8+
/scripts/check-autoload-files.sh @statamic/security

.github/workflows/tripwire.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tripwire
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
9+
10+
permissions: {}
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
16+
jobs:
17+
autoload-files:
18+
name: Verify autoload.files is unchanged
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
with:
27+
persist-credentials: false
28+
29+
- name: Verify autoload.files matches the approved allowlist
30+
run: bash scripts/check-autoload-files.sh

scripts/check-autoload-files.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -uo pipefail
3+
4+
EXPECTED='["src/helpers.php","src/namespaced_helpers.php","src/View/Blade/helpers.php"]'
5+
ACTUAL=$(jq -c '.autoload.files' composer.json)
6+
7+
if [ "$ACTUAL" != "$EXPECTED" ]; then
8+
echo "composer.json autoload.files has changed and must be reviewed."
9+
echo "Expected: $EXPECTED"
10+
echo "Actual: $ACTUAL"
11+
exit 1
12+
fi
13+
14+
echo "autoload.files matches the approved allowlist."

0 commit comments

Comments
 (0)