Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:WordPress/grunt-patch-wordpress in…
Browse files Browse the repository at this point in the history
…to remove/grunt-log
  • Loading branch information
aaronjorbin committed Mar 11, 2024
2 parents 7ad7382 + 311ff4d commit 39ad95a
Show file tree
Hide file tree
Showing 8 changed files with 19,921 additions and 11 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/props-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Props Bot

on:
# This event runs anytime a PR is (re)opened, updated, marked ready for review, or labeled.
# GitHub does not allow filtering the `labeled` event by a specific label.
# However, the logic below will short-circuit the workflow when the `props-bot` label is not the one being added.
# Note: The pull_request_target event is used instead of pull_request because this workflow needs permission to comment
# on the pull request. Because this event grants extra permissions to `GITHUB_TOKEN`, any code changes within the PR
# should be considered untrusted. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
pull_request_target:
types:
- opened
- synchronize
- reopened
- labeled
- ready_for_review
# This event runs anytime a comment is added or deleted.
# You cannot filter this event for PR comments only.
# However, the logic below does short-circuit the workflow for issues.
issue_comment:
type:
- created
# This event will run everytime a new PR review is initially submitted.
pull_request_review:
types:
- submitted
# This event runs anytime a PR review comment is created or deleted.
pull_request_review_comment:
types:
- created

# 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 }}-${{ contains( fromJSON( '["pull_request_target", "pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && github.head_ref || github.sha }}
cancel-in-progress: true

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

jobs:
# Compiles a list of props for a pull request.
#
# Performs the following steps:
# - Collects a list of contributor props and leaves a comment.
# - Removes the props-bot label, if necessary.
props-bot:
name: Generate a list of props
runs-on: ubuntu-latest
permissions:
# The action needs permission `write` permission for PRs in order to add a comment.
pull-requests: write
contents: read
timeout-minutes: 20
# The job will run when pull requests are open, ready for review and:
#
# - A comment is added to the pull request.
# - A review is created or commented on.
# - The pull request is opened, synchronized, marked ready for review, or reopened.
# - The `props-bot` label is added to the pull request.
if: |
(
github.event_name == 'issue_comment' && github.event.issue.pull_request ||
contains( fromJSON( '["pull_request_review", "pull_request_review_comment"]' ), github.event_name ) ||
github.event_name == 'pull_request_target' && github.event.action != 'labeled' ||
'props-bot' == github.event.label.name
) &&
( ! github.event.pull_request.draft && github.event.pull_request.state == 'open' || ! github.event.issue.draft && github.event.issue.state == 'open' )
steps:
- name: Gather a list of contributors
uses: WordPress/props-bot-action@trunk

- name: Remove the props-bot label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ github.event.action == 'labeled' && 'props-bot' == github.event.label.name }}
with:
retries: 2
retry-exempt-status-codes: 418
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: '${{ github.event.number }}',
name: 'props-bot'
});
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ jobs:

strategy:
matrix:
node-versions: [ '12', '14' ]
node-version:
- 20
- 21

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: ${{ matrix.node-version }}
check-latest: true
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
20
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,5 @@ Please follow the [WordPress coding standards](https://make.wordpress.org/core/h
- 1.0.0 - Add filemapping option. Bump minimum node version. Change code style. Update tooling.
- 2.0.0 - Bump minimum node version. Use @wordpress/scripts. Allow Credentials to be stored. Reduce Dependancy on Grunt.
- 3.0.0 - Bump minimum node version to [Node 12](https://github.com/WordPress/grunt-patch-wordpress/pull/89). [Update wp-scripts](https://github.com/WordPress/grunt-patch-wordpress/pull/87) and some general formatting. Use a [custom user agent for requests](https://github.com/WordPress/grunt-patch-wordpress/pull/85).
- 3.0.1 - Add support for more github URL formats. Internal: Use Github Actions instead of Travis.
- 4.0.0 - Bump minimum node version and some dependencies.
2 changes: 1 addition & 1 deletion lib/map_old_to_new_file_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const log = require( './log' );
/**
* Replaces file names in the passed filePath with the file names in the fileMappings.
*
* @param {string} filePath The path to the file where the filenames should be replaced.
* @param {string} filePath The path to the file where the filenames should be replaced.
* @param {Object} fileMappings The file names to replace and the file names they should be replaced with.
*
* @return {void}
Expand Down
Loading

0 comments on commit 39ad95a

Please sign in to comment.