Skip to content

[WordPress event] Dubai, UAE #1943

[WordPress event] Dubai, UAE

[WordPress event] Dubai, UAE #1943

Workflow file for this run

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/.
issues:
types:
- opened
- reopened
- labeled
- closed
- edited
- assigned
# 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:
types:
- created
- deleted
- edited
# 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.
issues: 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 == 'labeled' && 'props-bot' == github.event.label.name ) && ( ! github.event.issue.draft && github.event.issue.state == 'open' || github.event.issue.state == 'closed' )
steps:
- name: Gather a list of contributors
uses: WordPress/props-bot-action@trunk
# Optional arguments.
# with:
# # Allows a custom token to be passed.
# token: ${{ secrets.CUSTOM_PROPS_BOT_TOKEN }}
# # Specify the prop format to display. Default is `git`. Values should be comma separated.
# format: 'all'
- 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'
});