Skip to content

Commit

Permalink
ci: add chatops workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack committed Jan 30, 2025
1 parent b48b520 commit cf9ccd3
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: chatops
on:
issue_comment:
types: [created]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: github/[email protected]
id: command
with:
command: '.lock'
allowed_contexts: 'pull_request'
allowlist: 'primer/engineer-reviewers'
permissions: 'admin'
- name: Update branch protections
if: ${{ steps.command.outputs.continue == 'true' }}
run: gh api -X PUT /repos/primer/react/branches/main/protection -F 'lock_branch=true'

unlock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: github/[email protected]
id: command
with:
command: '.lock'
allowed_contexts: 'pull_request'
allowlist: 'primer/engineer-reviewers'
permissions: 'admin'
- name: Update branch protections
if: ${{ steps.command.outputs.continue == 'true' }}
run: gh api -X PUT /repos/primer/react/branches/main/protection -F 'lock_branch=false'

0 comments on commit cf9ccd3

Please sign in to comment.