mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 16:28:52 +00:00
40 lines
1.6 KiB
YAML
40 lines
1.6 KiB
YAML
name: Close PRs to master
|
|
|
|
# WARNING: Do NOT use org level secrets or checkout any code in this
|
|
# workflow
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened]
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
close:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- name: Check and close
|
|
run: |
|
|
has_label=$(gh pr view "$PR_NUM" --json labels -q '.labels | any(.name == "leave-open" or .name == "dependencies")')
|
|
if [[ "$has_label" != "true" ]]; then
|
|
echo "Not labeled 'leave-open' or 'dependencies'. Closing."
|
|
gh pr close "$PR_NUM" -c "$COMMENT"
|
|
fi
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
PR_NUM: ${{ github.event.pull_request.number }}
|
|
COMMENT: >
|
|
This PR is automatically closed because application
|
|
submission pull requests must be made against the new-pr
|
|
branch. Please choose the base repository as
|
|
"flathub/flathub" and the base as "new-pr" in the
|
|
"Comparing changes" screen when making the pull request.
|
|
The image below shows this. If this was closed in
|
|
error, please comment.
|
|

|
|

|