Run backport action when creating PR
This commit is contained in:
parent
7b703fdd5f
commit
c652fd5053
2 changed files with 1 additions and 30 deletions
29
.github/workflows/backport-check.yml
vendored
29
.github/workflows/backport-check.yml
vendored
|
@ -1,29 +0,0 @@
|
|||
# Copyright 2022 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
name: Backport Check
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, labeled]
|
||||
jobs:
|
||||
backport-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check pull request has a backport label
|
||||
env:
|
||||
EVENT_ACTION: ${{ github.event.action }}
|
||||
EVENT_LABEL_NAME: ${{ toJSON(github.event.label.name) }}
|
||||
EVENT_PULL_REQUEST_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
|
||||
shell: bash
|
||||
run: |
|
||||
LABELS="$EVENT_PULL_REQUEST_LABELS, $EVENT_LABEL_NAME"
|
||||
BACKPORT_LABELS="backport no-backport needs-backport needs-manual-backport"
|
||||
echo "Found labels: $LABELS"
|
||||
for BACKPORT_LABEL in $BACKPORT_LABELS; do
|
||||
echo "Checking for label '$BACKPORT_LABEL'"
|
||||
if echo "$LABELS" | grep -q "\"$BACKPORT_LABEL\""; then
|
||||
echo "Has '$BACKPORT_LABEL' label"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "Does not have any backport label"
|
||||
exit 1
|
2
.github/workflows/backport.yml
vendored
2
.github/workflows/backport.yml
vendored
|
@ -6,7 +6,7 @@ on:
|
|||
issue_comment:
|
||||
types: [created]
|
||||
pull_request:
|
||||
types: [closed]
|
||||
types: [opened, labeled, unlabeled, closed]
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
|
|
Loading…
Reference in a new issue