1
0
mirror of synced 2026-01-31 18:01:27 -05:00

Automatically close spammy repo-sync PRs (#18719)

* Update to latest find-pull-request-action

* Remove repetitive part of comments in allowed-actions.js

* Specify that we are seeking open PRs

* Use a PAT with site_admin scope granted to include spammy PRs
This commit is contained in:
James M. Greene
2021-04-13 13:43:22 -05:00
committed by GitHub
parent 46c16001c3
commit 16cdd98ea5
3 changed files with 17 additions and 14 deletions

View File

@@ -27,18 +27,19 @@ jobs:
steps:
- name: Find pull request
if: ${{ github.repository == 'github/docs' }}
uses: juliangruber/find-pull-request-action@2fc55e82a6d5d36fe1e7f1848f7e64fd02d99de9
uses: juliangruber/find-pull-request-action@db875662766249c049b2dcd85293892d61cb0b51
id: find-pull-request
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.DOCS_BOT_SPAM_VISION }}
branch: repo-sync
base: main
state: open
- name: Close pull request if unwanted
if: ${{ github.repository == 'github/docs' && steps.find-pull-request.outputs.number }}
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
github-token: ${{ secrets.DOCS_BOT_SPAM_VISION }}
script: |
const { owner, repo } = context.repo
@@ -119,13 +120,14 @@ jobs:
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
- name: Find pull request
uses: juliangruber/find-pull-request-action@2fc55e82a6d5d36fe1e7f1848f7e64fd02d99de9
uses: juliangruber/find-pull-request-action@db875662766249c049b2dcd85293892d61cb0b51
id: find-pull-request
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: repo-sync
base: main
author: Octomerger
state: open
- name: Approve pull request
if: ${{ steps.find-pull-request.outputs.number }}

View File

@@ -21,13 +21,14 @@ jobs:
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
- name: Find original Pull Request
uses: juliangruber/find-pull-request-action@2fc55e82a6d5d36fe1e7f1848f7e64fd02d99de9
uses: juliangruber/find-pull-request-action@db875662766249c049b2dcd85293892d61cb0b51
id: pr
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: translations
base: main
author: octoglot
state: open
- if: ${{ steps.pr.outputs.number }}
name: Check if already labeled
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9