Skip to content

Commit 8007863

Browse files
committed
Merge branch '6.x' into feature/add-cf-to-video-fieldtype
2 parents f10c70b + 7b93712 commit 8007863

513 files changed

Lines changed: 6587 additions & 861 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"
11+
cooldown:
12+
default-days: 7

.github/workflows/code-style-lint.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,38 @@ name: Lint code style issues
33
on:
44
pull_request:
55

6+
permissions: {}
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
612
jobs:
7-
lint-code-styling:
13+
lint-code-styling: # zizmor: ignore[anonymous-definition]
814
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
917

1018
steps:
1119
- name: Checkout code
12-
uses: actions/checkout@v4
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
1323

1424
- name: Get changed files
1525
id: changed-files
16-
uses: tj-actions/changed-files@v46
26+
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
1727
with:
1828
files: |
1929
**.php
2030
2131
- name: Check PHP code style issues
2232
if: steps.changed-files.outputs.any_modified == 'true'
23-
uses: aglipanci/laravel-pint-action@v2
33+
uses: aglipanci/laravel-pint-action@36de00d5f5a8a4e12d443e01671daa12a18f4c79 # 2.6
2434
with:
2535
testMode: true
2636
verboseMode: true
2737
pintVersion: 1.16.0
38+
39+
- name: Check Statamic\trans imports
40+
run: bash scripts/check-trans-import.sh

.github/workflows/pr-title.yml

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,13 @@ on:
44
pull_request:
55
types: [opened, edited, synchronize, reopened]
66

7-
jobs:
8-
pr-title:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Validate PR title matches target branch
12-
env:
13-
PR_TITLE: ${{ github.event.pull_request.title }}
14-
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
15-
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
16-
run: |
17-
# Validates PR title against target branch
18-
# Returns error message if invalid, empty string if valid
19-
validate_pr_title() {
20-
local target_branch="$1"
21-
local pr_title="$2"
22-
local default_branch="$3"
23-
24-
# Check if target branch is a version branch (e.g., 5.x, 4.x)
25-
if [[ $target_branch =~ ^([0-9]+)\.x$ ]]; then
26-
local version="${BASH_REMATCH[1]}"
27-
if [[ ! $pr_title =~ ^\[$version\.x\][[:space:]] ]]; then
28-
echo "PR targeting '$target_branch' must have title starting with '[$version.x] '"
29-
return
30-
fi
31-
32-
# Check if target branch is master (next major version)
33-
elif [[ $target_branch == "master" ]]; then
34-
local current_version="${default_branch//\.x/}"
35-
local next_version=$((current_version + 1))
36-
if [[ ! $pr_title =~ ^\[$next_version\.x\][[:space:]] ]]; then
37-
echo "PR targeting 'master' must have title starting with '[$next_version.x] '"
38-
return
39-
fi
40-
41-
# For other branches, just enforce that there's a version prefix
42-
else
43-
if [[ ! $pr_title =~ ^\[[0-9]+\.x\][[:space:]] ]]; then
44-
echo "PR title must start with a version prefix like '[5.x] '"
45-
return
46-
fi
47-
fi
7+
permissions: {}
488

49-
echo ""
50-
}
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
5112

52-
echo "PR Title: $PR_TITLE"
53-
echo "Base Branch: $BASE_BRANCH"
54-
echo "Default Branch: $DEFAULT_BRANCH"
55-
56-
ERROR=$(validate_pr_title "$BASE_BRANCH" "$PR_TITLE" "$DEFAULT_BRANCH")
57-
58-
if [[ -n $ERROR ]]; then
59-
echo $ERROR
60-
exit 1
61-
fi
62-
63-
echo "PR title validation passed"
13+
jobs:
14+
pr-title:
15+
uses: statamic/.github/.github/workflows/pr-title.yml@bebe92309b4276e45ebc0d0c65854fb2ecf786ba
16+
permissions: {}
Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,18 @@
11
name: Pull Requests
22

3-
# Credit: https://github.com/github/docs/blob/main/.github/workflows/notify-when-maintainers-cannot-edit.yaml
4-
# https://github.com/laravel/.github/blob/main/.github/workflows/pull-requests.yml
5-
63
on:
7-
pull_request_target:
4+
pull_request_target: # zizmor: ignore[dangerous-triggers]
85
types:
96
- opened
107

11-
permissions:
12-
pull-requests: write
8+
permissions: {}
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
12+
cancel-in-progress: true
1313

1414
jobs:
1515
uneditable:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/github-script@v7
19-
with:
20-
script: |
21-
const repo = context.repo.repo;
22-
23-
const query = `
24-
query($number: Int!) {
25-
repository(owner: "statamic", name: "${repo}") {
26-
pullRequest(number: $number) {
27-
headRepositoryOwner {
28-
login
29-
}
30-
maintainerCanModify
31-
state
32-
}
33-
}
34-
}
35-
`;
36-
37-
const pullNumber = context.issue.number;
38-
const variables = { number: pullNumber };
39-
40-
try {
41-
console.log(`Check for maintainer edit access ...`);
42-
const result = await github.graphql(query, variables);
43-
console.log(JSON.stringify(result, null, 2));
44-
const pullRequest = result.repository.pullRequest;
45-
46-
if (pullRequest.headRepositoryOwner.login === 'statamic') {
47-
console.log('PR owned by statamic');
48-
return;
49-
}
50-
51-
if (pullRequest.state !== 'OPEN') {
52-
console.log('PR has already been closed or merged');
53-
return;
54-
}
55-
56-
if (!pullRequest.maintainerCanModify) {
57-
console.log('PR not owned by statamic and does not have maintainer edits enabled');
58-
59-
await github.rest.issues.createComment({
60-
issue_number: pullNumber,
61-
owner: 'statamic',
62-
repo,
63-
body: "Thanks for submitting a PR!\n\nIn order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. For information on how to do this, [see the relevant GitHub documentation](https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork). Additionally, GitHub doesn't allow maintainer permissions from organization accounts. Please resubmit this PR from a personal GitHub account with maintainer permissions enabled."
64-
});
65-
66-
await github.rest.pulls.update({
67-
pull_number: pullNumber,
68-
owner: 'statamic',
69-
repo,
70-
state: 'closed'
71-
});
72-
}
73-
} catch(e) {
74-
console.log(e);
75-
}
16+
uses: statamic/.github/.github/workflows/pull-requests.yml@bebe92309b4276e45ebc0d0c65854fb2ecf786ba
17+
permissions:
18+
pull-requests: write # post comment and close PRs that don't allow maintainer edits

.github/workflows/release.yml

Lines changed: 26 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
name: Create Release
22

3-
on:
3+
on: # zizmor: ignore[concurrency-limits]
44
push:
55
tags:
66
- 'v*'
77

8+
permissions: {}
9+
810
jobs:
9-
build:
11+
build: # zizmor: ignore[anonymous-definition]
1012
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write # create GitHub release and upload assets
1115
steps:
1216
- name: Checkout code
13-
uses: actions/checkout@v4
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
1420

1521
- name: Use Node.js 20.19.0
16-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1723
with:
1824
node-version: 20.19.0
25+
package-manager-cache: false
1926

2027
- name: Install dependencies
2128
run: npm ci
@@ -25,62 +32,27 @@ jobs:
2532

2633
- name: Get Changelog
2734
id: changelog
28-
uses: statamic/changelog-action@v1
35+
uses: statamic/changelog-action@5d112d0d790cdeeb5adca3e584e37edc474ab51b # v1.0.2
2936
with:
3037
version: ${{ github.ref }}
3138

3239
- name: Create release
33-
id: create_release
34-
uses: actions/create-release@v1
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
with:
38-
tag_name: ${{ steps.changelog.outputs.version }}
39-
release_name: ${{ steps.changelog.outputs.version }}
40-
body: ${{ steps.changelog.outputs.text }}
41-
prerelease: false
42-
43-
- name: Upload dist zip to release
44-
uses: actions/upload-release-asset@v1.0.1
4540
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
with:
48-
upload_url: ${{ steps.create_release.outputs.upload_url }}
49-
asset_path: ./resources/dist.tar.gz
50-
asset_name: dist.tar.gz
51-
asset_content_type: application/tar+gz
52-
53-
- name: Upload dist-dev zip to release
54-
uses: actions/upload-release-asset@v1.0.1
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
with:
58-
upload_url: ${{ steps.create_release.outputs.upload_url }}
59-
asset_path: ./resources/dist-dev.tar.gz
60-
asset_name: dist-dev.tar.gz
61-
asset_content_type: application/tar+gz
62-
63-
- name: Upload dist-frontend zip to release
64-
uses: actions/upload-release-asset@v1.0.1
65-
env:
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
with:
68-
upload_url: ${{ steps.create_release.outputs.upload_url }}
69-
asset_path: ./resources/dist-frontend.tar.gz
70-
asset_name: dist-frontend.tar.gz
71-
asset_content_type: application/tar+gz
72-
73-
- name: Upload dist-package zip to release
74-
uses: actions/upload-release-asset@v1.0.1
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
with:
78-
upload_url: ${{ steps.create_release.outputs.upload_url }}
79-
asset_path: ./resources/dist-package.tar.gz
80-
asset_name: dist-package.tar.gz
81-
asset_content_type: application/tar+gz
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
RELEASE_VERSION: ${{ steps.changelog.outputs.version }}
43+
RELEASE_NOTES: ${{ steps.changelog.outputs.text }}
44+
run: |
45+
gh release create "$RELEASE_VERSION" \
46+
--title "$RELEASE_VERSION" \
47+
--notes "$RELEASE_NOTES" \
48+
./resources/dist.tar.gz \
49+
./resources/dist-dev.tar.gz \
50+
./resources/dist-frontend.tar.gz \
51+
./resources/dist-package.tar.gz
8252
8353
- name: Deploy Storybook to Forge
8454
continue-on-error: true
55+
env:
56+
FORGE_STORYBOOK_WEBHOOK: ${{ secrets.FORGE_STORYBOOK_WEBHOOK }}
8557
run: |
86-
curl -X POST "${{ secrets.FORGE_STORYBOOK_WEBHOOK }}"
58+
curl -X POST "$FORGE_STORYBOOK_WEBHOOK"

.github/workflows/stale.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
name: "Close stale issues"
2-
on:
2+
on: # zizmor: ignore[concurrency-limits]
33
workflow_dispatch:
44
schedule:
55
- cron: "30 1 * * *"
66

7+
permissions: {}
8+
79
jobs:
810
stale:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/stale@v9
12-
with:
13-
repo-token: ${{ secrets.GITHUB_TOKEN }}
14-
days-before-stale: 60
15-
days-before-close: 7
16-
ascending: true
17-
only-labels: 'needs more info'
18-
stale-issue-label: stale
19-
stale-issue-message: >
20-
This issue has not had recent activity and has been marked as stale — by me, a robot.
21-
Simply reply to keep it open and send me away. If you do nothing, I will close it in
22-
a week. I have no feelings, so whatever you do is fine by me.
11+
uses: statamic/.github/.github/workflows/stale.yml@bebe92309b4276e45ebc0d0c65854fb2ecf786ba
12+
permissions:
13+
issues: write # mark issues stale and close them

0 commit comments

Comments
 (0)