Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
59d116e
Add more workflow file linting with Octoscan, Zizmor, and Poutine
johnbillion Sep 5, 2025
b1191b9
Docs.
johnbillion Sep 5, 2025
7140777
Disable some Octoscan rules.
johnbillion Sep 5, 2025
73cbaee
Let's calm this down a bit.
johnbillion Sep 5, 2025
3e3a0bb
The git credentials need to be retained, so make it explicit.
johnbillion Sep 6, 2025
9cedc48
Make more use of environment variables.
johnbillion Sep 6, 2025
446a55b
Be more explicit about secrets.
johnbillion Sep 6, 2025
eac6a90
Don't persist git credentials here.
johnbillion Sep 6, 2025
76a3b2e
Combine these two steps into one.
johnbillion Sep 6, 2025
16f38dc
Temporarily disable this slow workflow.
johnbillion Sep 6, 2025
8697659
No need to wait for SARIF processing.
johnbillion Sep 6, 2025
aa4b18d
Indentation.
johnbillion Sep 6, 2025
817f118
Instruct Zizmor to fail when it can't process collected actions or wo…
johnbillion Sep 6, 2025
aaaa6ab
Merge branch 'trunk' into workflow-linting
johnbillion Sep 19, 2025
79a401a
Merge branch 'trunk' into workflow-linting
johnbillion Oct 6, 2025
64b09bf
Update everything.
johnbillion Oct 7, 2025
b54d2f6
Merge branch 'trunk' into workflow-linting
johnbillion Jan 9, 2026
c6ce12a
Merge branch 'trunk' into workflow-linting
johnbillion Mar 17, 2026
e3062e9
Remove Poutine and Octoscan in favour of Actionlint and Zizmor.
johnbillion Mar 17, 2026
501e970
Add some docs about running locally.
johnbillion Mar 17, 2026
ecd823c
Merge branch 'trunk' into workflow-linting
johnbillion Mar 17, 2026
8ced8e4
Update everything.
johnbillion Mar 17, 2026
fb82330
Update .github/workflows/reusable-workflow-lint.yml
johnbillion Apr 15, 2026
d1962c2
Apply suggestions from code review
johnbillion Apr 20, 2026
066e83c
Remove this processing optimisation.
johnbillion Apr 21, 2026
48d73ba
Merge branch 'trunk' into workflow-linting
johnbillion Apr 21, 2026
450a721
Reinstate the test coverage workflow.
johnbillion Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/commit-built-file-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ jobs:
path: 'pr-repo'
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
token: ${{ env.ACCESS_TOKEN }}
persist-credentials: true

- name: Apply patch
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
working-directory: 'pr-repo'
run: git apply ${{ github.workspace }}/changes.diff
run: git apply "$GITHUB_WORKSPACE/changes.diff"

- name: Display changes to versioned files
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
Expand All @@ -149,7 +150,7 @@ jobs:
GH_APP_ID: ${{ secrets.GH_PR_BUILT_FILES_APP_ID }}
run: |
git config user.name "wordpress-develop-pr-bot[bot]"
git config user.email ${{ env.GH_APP_ID }}+wordpress-develop-pr-bot[bot]@users.noreply.github.com
git config user.email "${GH_APP_ID}+wordpress-develop-pr-bot[bot]@users.noreply.github.com"

- name: Stage changes
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
uses: ./.github/workflows/reusable-support-json-reader-v1.yml
permissions:
contents: read
secrets: inherit
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
with:
wp-version: ${{ inputs.wp-version }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/local-docker-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ jobs:
uses: ./.github/workflows/reusable-support-json-reader-v1.yml
permissions:
contents: read
secrets: inherit
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
with:
wp-version: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ jobs:
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
permissions:
contents: read
secrets: inherit
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -143,7 +145,9 @@ jobs:
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
permissions:
contents: read
secrets: inherit
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -195,7 +199,9 @@ jobs:
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
permissions:
contents: read
secrets: inherit
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -243,7 +249,9 @@ jobs:
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
permissions:
contents: read
secrets: inherit
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -272,7 +280,9 @@ jobs:
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
permissions:
contents: read
secrets: inherit
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
if: ${{ ! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-check-built-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
Expand Down
23 changes: 9 additions & 14 deletions .github/workflows/reusable-cleanup-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ jobs:
COMMIT_MESSAGE="$(echo "$COMMIT_MSG_RAW" | sed -n '$p')"
echo "svn_revision_number=$(echo "$COMMIT_MESSAGE" | sed -n 's/.*git-svn-id: https:\/\/develop.svn.wordpress.org\/[^@]*@\([0-9]*\) .*/\1/p')" >> "$GITHUB_OUTPUT"

- name: Find pull requests
id: linked-prs
- name: Find and close pull requests
Comment thread
johnbillion marked this conversation as resolved.
Outdated
if: ${{ steps.trac-tickets.outputs.fixed_list != '' && steps.git-svn-id.outputs.svn_revision_number != '' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
FIXED_LIST: ${{ steps.trac-tickets.outputs.fixed_list }}
SVN_REVISION_NUMBER: ${{ steps.git-svn-id.outputs.svn_revision_number }}
with:
script: |
const fixedList = "${{ steps.trac-tickets.outputs.fixed_list }}".split(' ').filter(Boolean);
const fixedList = process.env.FIXED_LIST.split(' ').filter(Boolean);
const svnRevisionNumber = process.env.SVN_REVISION_NUMBER;
const githubSha = process.env.GITHUB_SHA;
let prNumbers = [];

for (const ticket of fixedList) {
Expand Down Expand Up @@ -78,19 +82,10 @@ jobs:
prNumbers.push(...result.search.nodes.map(pr => pr.number));
}

return prNumbers;

- name: Comment and close pull requests
if: ${{ steps.trac-tickets.outputs.fixed_list != '' && steps.git-svn-id.outputs.svn_revision_number != '' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const prNumbers = ${{ steps.linked-prs.outputs.result }};

Comment thread
johnbillion marked this conversation as resolved.
const commentBody = `A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: [${{ steps.git-svn-id.outputs.svn_revision_number }}](https://core.trac.wordpress.org/changeset/${{ steps.git-svn-id.outputs.svn_revision_number }})
GitHub commit: https://github.com/WordPress/wordpress-develop/commit/${{ github.sha }}
SVN changeset: [${svnRevisionNumber}](https://core.trac.wordpress.org/changeset/${svnRevisionNumber})
GitHub commit: https://github.com/WordPress/wordpress-develop/commit/${githubSha}

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.`;

Expand Down
104 changes: 98 additions & 6 deletions .github/workflows/reusable-workflow-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ permissions: {}
jobs:
# Runs the actionlint GitHub Action workflow file linter.
#
# See https://github.com/rhysd/actionlint.
#
# This helps guard against common mistakes including strong type checking for expressions (${{ }}), security checks,
# `run:` script checking, glob syntax validation, and more.
#
# Performs the following steps:
# - Checks out the repository.
# - Runs actionlint.
actionlint:
name: Run actionlint
runs-on: ubuntu-24.04
Expand All @@ -26,9 +24,103 @@ jobs:
persist-credentials: false
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

# actionlint is static checker for GitHub Actions workflow files.
# See https://github.com/rhysd/actionlint.
- name: Run actionlint
uses: docker://rhysd/actionlint@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9 # v1.7.7
with:
args: "-color -verbose"

# Runs the Octoscan GitHub Action workflow file linter.
#
# See https://github.com/synacktiv/octoscan
#
# This helps guard against injection attacks, credential exposure, vulnerable actions, repository jacking,
# dangerous checkouts, and artifact security issues.
octoscan:
name: Octoscan
runs-on: ubuntu-24.04
permissions:
security-events: write
actions: read
contents: read
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Run octoscan
id: octoscan
uses: synacktiv/action-octoscan@6b1cf2343893dfb9e5f75652388bd2dc83f456b0 # v1.0.0
with:
filter_triggers: ''
disable_rules: 'local-action,runner-label'

- name: Upload SARIF file to GitHub
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
with:
sarif_file: "${{steps.octoscan.outputs.sarif_output}}"
category: octoscan
wait-for-processing: false

# Runs the Zizmor GitHub Action workflow file linter.
#
# See https://github.com/zizmorcore/zizmor
#
# This helps guard against supply chain attacks, unpinned dependencies, excessive permissions,
# dangerous triggers, credential leaks, and sophisticated security vulnerabilities.
Comment thread
johnbillion marked this conversation as resolved.
zizmor:
name: Zizmor
runs-on: ubuntu-24.04
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Install the latest version of uv
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v6.6.0

- name: Run zizmor
run: uvx zizmor@1.12.0 --persona=regular --format=sarif --strict-collection . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
with:
sarif_file: results.sarif
category: zizmor
wait-for-processing: false
Comment thread
johnbillion marked this conversation as resolved.
Outdated

# Runs the Poutine GitHub Action workflow file linter.
#
# See https://github.com/boostsecurityio/poutine
#
# This helps guard against CI/CD pipeline risks, supply chain vulnerabilities, excessive permissions,
# and dangerous build platform configurations.
poutine:
name: Poutine
runs-on: ubuntu-24.04
permissions:
security-events: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Run Poutine
uses: boostsecurityio/poutine-action@84c0a0d32e8d57ae12651222be1eb15351429228 # v0.15.2

- name: Upload poutine SARIF file
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
with:
sarif_file: results.sarif
category: poutine
wait-for-processing: false
18 changes: 9 additions & 9 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ on:
- 'docker-compose.yml'
- 'phpunit.xml.dist'
- 'tests/phpunit/multisite.xml'
pull_request:
branches:
- trunk
paths:
- '.github/workflows/test-coverage.yml'
- '.github/workflows/reusable-phpunit-tests-v3.yml'
- 'docker-compose.yml'
- 'phpunit.xml.dist'
- 'tests/phpunit/multisite.xml'
# pull_request:
Comment thread
johnbillion marked this conversation as resolved.
Outdated
# branches:
# - trunk
# paths:
# - '.github/workflows/test-coverage.yml'
# - '.github/workflows/reusable-phpunit-tests-v3.yml'
# - 'docker-compose.yml'
# - 'phpunit.xml.dist'
# - 'tests/phpunit/multisite.xml'
# Once daily at 00:00 UTC.
schedule:
- cron: '0 0 * * *'
Expand Down
Loading