Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
3f13362
Expand dependabot to some npm dependencies.
desrosj Jan 22, 2025
8c2b076
Try adjustment.
desrosj Jan 23, 2025
222a04c
Re-add extra group.
desrosj Jan 23, 2025
8f96421
More dependabot adjustments.
desrosj Jan 23, 2025
6a19eb0
Remove `ignore`.
desrosj Jan 23, 2025
30ace4c
Ignore all `@wordpress` pacakges.
desrosj Jan 23, 2025
a7dec85
Fix ignore statement.
desrosj Jan 23, 2025
23a01c5
Add some external libraries.
desrosj Jan 24, 2025
9cc2b1d
More tweaks
desrosj Jan 24, 2025
3ddeed1
Adjust groups to indicate dependency type.
desrosj Jan 27, 2025
c1b5e61
Downgrade dependancies to test updates.
desrosj Jan 27, 2025
4719a13
Add playwright group.
desrosj Jan 27, 2025
0b1ba78
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Jan 27, 2025
e2a468d
Downgrade more packages.
desrosj Jan 27, 2025
b707f28
Test playwright grouping.
desrosj Jan 28, 2025
027a67c
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Jan 28, 2025
57537c3
A few more package adjustments.
desrosj Jan 28, 2025
7507802
Increase limit for now.
desrosj Jan 28, 2025
79115cc
Downgrade. dotenv further.
desrosj Jan 28, 2025
2d10fc6
More adjustments to groups.
desrosj Jan 28, 2025
e2bea61
Try flushing PRs.
desrosj Jan 28, 2025
b3c8af6
Ignore all.
desrosj Jan 28, 2025
38a1845
Re-enable.
desrosj Jan 28, 2025
9e4496b
Add excluded.
desrosj Jan 28, 2025
6fb11fc
Some adjustments.
desrosj Jan 28, 2025
a23db35
Start fresh once more.
desrosj Jan 28, 2025
ae69129
Re-add.
desrosj Jan 28, 2025
0e95e60
Add group for `@wordpress.
desrosj Jan 28, 2025
6a6e2e5
Don't include `@wordpress` right now.
desrosj Jan 28, 2025
c251f37
Test a Composer dependabot group.
desrosj Jan 29, 2025
1ba60b4
Add ignore list.
desrosj Jan 29, 2025
69f67aa
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Feb 3, 2025
239163a
Experiment with auto-updating built files in PRs.
desrosj Feb 3, 2025
cc4a937
Ignore all dependencies.
desrosj Feb 3, 2025
a2c256c
Retrack dependencies.
desrosj Feb 3, 2025
1074aad
Remove repo check.
desrosj Feb 3, 2025
c9433d6
Test.
desrosj Feb 3, 2025
e175c65
Check current workflow not `workflow_target`.
desrosj Feb 3, 2025
e575b9f
Try this.
desrosj Feb 3, 2025
b9c7bab
Try this
desrosj Feb 3, 2025
6da1ca2
Try again.
desrosj Feb 3, 2025
12a40a4
Configure author.
desrosj Feb 3, 2025
fff825f
Close all PRs.
desrosj Feb 3, 2025
6f74be8
Recreate PRs.
desrosj Feb 3, 2025
33ce9e7
Masquerade as Dependabot.
desrosj Feb 3, 2025
47d1523
Fix syntax error.
desrosj Feb 3, 2025
03dbac4
Fix syntax error.
desrosj Feb 3, 2025
cad3b5e
Remember to push things.
desrosj Feb 3, 2025
97b7ef7
Push to correct branch.
desrosj Feb 3, 2025
b65a29c
Reset PRs.
desrosj Feb 3, 2025
c733623
Retrack npm.
desrosj Feb 3, 2025
ed1083c
Try issues write.
desrosj Feb 3, 2025
d66ee74
Another attempt
desrosj Feb 3, 2025
9d09a35
Retry
desrosj Feb 3, 2025
7a868f3
Try
desrosj Feb 3, 2025
fafa04c
Try
desrosj Feb 3, 2025
29af916
Adjustment.
desrosj Feb 3, 2025
cfbb85d
Please work.🙏
desrosj Feb 3, 2025
fca3bfc
Maybe?
desrosj Feb 3, 2025
83b2863
Fix conditions.
desrosj Feb 3, 2025
9789fa4
Maybe?
desrosj Feb 3, 2025
05e961d
Try this
desrosj Feb 3, 2025
9f6e27e
Whoops
desrosj Feb 3, 2025
5483a6b
Try contents write.
desrosj Feb 3, 2025
00379bd
Try another tweak
desrosj Feb 3, 2025
57723c8
??
desrosj Feb 3, 2025
9d4d6f3
Try not editing git config without `persist-credentials`.
desrosj Feb 4, 2025
3c60970
Adjustments
desrosj Feb 4, 2025
2c1a91f
Strip down permissions.
desrosj Feb 4, 2025
4a65d43
Try write.
desrosj Feb 4, 2025
48551f4
Try contents.
desrosj Feb 4, 2025
53d4cee
Fix linting.
desrosj Feb 4, 2025
47d83bc
More linting.
desrosj Feb 4, 2025
aba8e8f
Try GH App.
desrosj Feb 4, 2025
3206f67
stay on target.
desrosj Feb 4, 2025
88a36cd
Try this.
desrosj Feb 4, 2025
d2a82c8
Try
desrosj Feb 4, 2025
b5ad3cc
Try old code.
desrosj Feb 4, 2025
4c262c6
Try nesting.
desrosj Feb 4, 2025
8532e5f
Remove instead.
desrosj Feb 4, 2025
40c7e93
Close all PRs.
desrosj Feb 4, 2025
b4d9704
Re-track.
desrosj Feb 4, 2025
971490d
Stop pretending to be dependabot.
desrosj Feb 4, 2025
736b04c
Try no skip comment.
desrosj Feb 4, 2025
18da140
Adjust order.
desrosj Feb 4, 2025
5dcfbc9
Re-add skip comment.
desrosj Feb 4, 2025
5619979
Switch back to dependabot.
desrosj Feb 4, 2025
fa0e0d2
Remove echo.
desrosj Feb 4, 2025
3f670f1
Linting fixes.
desrosj Feb 4, 2025
4acf26f
Linting fix.
desrosj Feb 4, 2025
546b1fe
Prevent a double run.
desrosj Feb 4, 2025
23b0035
Try
desrosj Feb 4, 2025
a724aef
Maybe this?
desrosj Feb 4, 2025
75fd831
More linting fixes.
desrosj Feb 4, 2025
33b5c58
Last one? 🙏
desrosj Feb 4, 2025
fa6cafd
One for the road
desrosj Feb 4, 2025
36e320f
maybe
desrosj Feb 4, 2025
ef6752e
Track down
desrosj Feb 4, 2025
6f9637a
👀
desrosj Feb 4, 2025
2b49f5e
Put it all back
desrosj Feb 4, 2025
4d429cf
Will this end?
desrosj Feb 4, 2025
d70ce19
Try
desrosj Feb 4, 2025
0fc85f8
Reset PRs.
desrosj Feb 4, 2025
129c0a5
Re-enable PRs for npm.
desrosj Feb 4, 2025
98251dd
Reverser certs.
desrosj Feb 4, 2025
dfa383a
Try `pull_request`.
desrosj Feb 4, 2025
d51ac33
Has to be target
desrosj Feb 5, 2025
ff81139
Bump the dev-docker group with 3 updates
dependabot[bot] Feb 5, 2025
d630755
Automation: Updating built files with changes. [dependabot skip]
dependabot[bot] Feb 5, 2025
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
98 changes: 98 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,101 @@ updates:
composer-packages:
patterns:
- "composer/ca-bundle"

# Monitor some npm dependencies for updates in groups.
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 50
ignore:
- dependency-name: "@wordpress/*"
groups:
##
# Groups for updating devDependencies.
##

# Dependencies related to Playwright testing (E2E, performance).
tests-playwright:
patterns:
- "*playwright*"
# Dependencies related to JavaScript testing with QUnit.
tests-qunit:
patterns:
- "*qunit*"
- "sinon*"
# Dependencies related to CSS and SASS building and manilupating.
dev-css-sass:
patterns:
- "autoprefixer"
# postcss and css related dependencies.
- "*css*"
- "*sass"
# Dependencies related to the Webpack build process.
dev-webpack:
patterns:
- "*webpack*"
- "react-refresh"
- "source-map-loader"
# Dependencies related to the local Docker development environment.
dev-docker:
patterns:
- "dotenv*"
- "wait-on"
# Dependencies that do not fall into a specific grouping.
dev-miscellaneous:
patterns:
- "chalk"
- "check-node-version"
- "ink-docstrap"
- "install-changed"
- "matchdep"
- "uuid"
# Dependencies related to JavaScript minification.
dev-uglify:
patterns:
- "*uglify*"
# All GruntJS related dependencies that do not relate to another group.
dev-grunt:
patterns:
- "*grunt*"

##
# Groups for updating production dependencies.
##

# Dependencies related to jQuery and its ecosystem.
external-jquery:
patterns:
- "jquery*"
# Dependencies related to React and its ecosystem.
external-react:
patterns:
- "react*"
- "!react-refresh"
# Dependencies used for bundling polyfill libraries into WordPress.
external-polyfills:
patterns:
- "core-js-url-browser"
- "element-closest"
- "formdata-polyfill"
- "imagesloaded"
- "objectFitPolyfill"
- "polyfill-library"
- "regenerator-runtime"
- "whatwg-fetch"
- "wicg-inert"
# Dependencies related to the Masonry library.
external-masonry:
patterns:
- "masonry-layout"
# Dependencies that do not fall into a specific grouping.
external-miscellaneous:
patterns:
- "backbone"
- "clipboard"
- "hoverintent"
- "json2php"
- "lodash"
- "moment"
- "underscore"
157 changes: 157 additions & 0 deletions .github/workflows/pull-requests-built-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Responsible for checking pull requests for changes to built files.
name: Manage Built Files for PRs

on:
pull_request_target:
branches:
- trunk
- '6.[8-9]'
- '[7-9].[0-9]'
paths:
# Any change to a CSS, JavaScript, JSON, or SASS file should run checks.
- '**.css'
- '**.js'
- '**.json'
- '**.sass'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# Confirm any changes to relevant workflow files.
- '.github/workflows/pull-requests-built-files.yml'

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.sha }}

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}

jobs:
# Checks a PR for uncommitted changes to built files.
update-built-files:
name: Updates built files when necessary
runs-on: ubuntu-24.04
permissions:
contents: write
if: ${{ github.event_name == 'pull_request_target' && github.event.commits < 2 && 'dependabot[bot]' == github.actor }}
steps:
- name: Generate Installation Token
id: generate_token
env:
GH_APP_ID: ${{ secrets.GH_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
run: |
echo "${{ env.GH_APP_PRIVATE_KEY }}" > private-key.pem

APP_ID=${{ env.GH_APP_ID }}

# Generate JWT
JWT=$(python3 - <<EOF
import jwt, time
private_key = open("private-key.pem", "r").read()
payload = {
"iat": int(time.time()),
"exp": int(time.time()) + 600, # 10-minute expiration
"iss": $APP_ID
}
print(jwt.encode(payload, private_key, algorithm="RS256"))
EOF
)

# Get Installation ID
INSTALLATION_ID=$(curl -s -X GET -H "Authorization: Bearer $JWT" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/app/installations | jq -r '.[0].id')

# Request Installation Access Token
ACCESS_TOKEN=$(curl -s -X POST -H "Authorization: Bearer $JWT" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/app/installations/$INSTALLATION_ID/access_tokens | jq -r '.token')

echo "ACCESS_TOKEN=$ACCESS_TOKEN" >> "$GITHUB_ENV"

rm -f private-key.pem

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.head_ref }}
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
token: ${{ env.ACCESS_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: '.nvmrc'
cache: npm

# This date is used to ensure that the PHPCS cache is cleared at least once every week.
# http://man7.org/linux/man-pages/man1/date.1.html
- name: "Get last Monday's date"
id: get-date
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"

# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
with:
custom-cache-suffix: ${{ steps.get-date.outputs.date }}

- name: Log debug information
run: |
npm --version
node --version
curl --version
git --version

- name: Install npm Dependencies
run: npm ci

- name: Run SASS precommit tasks
run: npm run grunt precommit:css

- name: Run Emoji precommit task
run: npm run grunt precommit:emoji
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run certificate tasks
run: npm run grunt copy:certificates

- name: Build WordPress
run: npm run build:dev

- name: Configure git user name and email
run: |
git config user.name "dependabot[bot]"
git config user.email 49699333+dependabot[bot]@users.noreply.github.com

- name: Ensure version-controlled files are not modified or deleted during building
id: built-file-check
run: |
diff_output=$(git diff)
if [ -n "$diff_output" ]; then
echo "uncommitted_changes=$(echo $diff_output)" >> "$GITHUB_OUTPUT"
fi

- name: Stage changes
if: ${{ steps.built-file-check.outputs.uncommitted_changes != '' }}
run: git add .

- name: Commit changes
if: ${{ steps.built-file-check.outputs.uncommitted_changes != '' }}
run: |
git commit -m "Automation: Updating built files with changes. [dependabot skip]"

- name: Push changes
if: ${{ steps.built-file-check.outputs.uncommitted_changes != '' }}
run: git push

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ext-dom": "*"
},
"require-dev": {
"composer/ca-bundle": "1.5.5",
"composer/ca-bundle": "1.5.3",
"squizlabs/php_codesniffer": "3.10.3",
"wp-coding-standards/wpcs": "~3.1.0",
"phpcompatibility/phpcompatibility-wp": "~2.1.3",
Expand Down
Loading