-
Notifications
You must be signed in to change notification settings - Fork 212
34 lines (31 loc) · 1.12 KB
/
label_new_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Label new PR
# ℹ️ https://github.com/WordPress/openverse/blob/main/.github/GITHUB.md#label-new-pr
on:
pull_request_target:
types:
# Only set labels when the PR is created, this should fire `labeled`
# events that will trigger the checks defined in `pr_label_check.yml`.
- opened
jobs:
set_label:
name: Set labels
runs-on: ubuntu-latest
steps:
- name: Trigger remote workflow
uses: felixp8/[email protected]
env:
PR_URL: ${{ github.event.pull_request.html_url }}
with:
owner: WordPress
repo: openverse
token: ${{ secrets.ACCESS_TOKEN }} # Cannot create repository dispatch using GITHUB_TOKEN
event_type: label_pr
client_payload: ${{ format('{{"pr_url":"{0}"}}', env.PR_URL) }}
wait_time: 5 # check every 5 seconds
max_time: 120 # timeout after 2 minutes
- uses: actions/checkout@v3
- name: Add default label in case of failure
uses: actions-ecosystem/action-add-labels@v1
if: ${{ failure() }}
with:
labels: "🚦 status: awaiting triage"