Skip to content

Commit

Permalink
Merge pull request #99 from felddy/improvement/label-automerge-prs
Browse files Browse the repository at this point in the history
Add workflow to manage automerge PRs
  • Loading branch information
felddy authored Jun 15, 2023
2 parents a1bc01b + 1213cec commit 6900560
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/label-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Label auto-merge PRs

on:
pull_request_target:
types: [auto_merge_enabled, auto_merge_disabled]

env:
LABEL_NAME: 'automerge :bell:'

jobs:
add-remove-label:
runs-on: ubuntu-latest
steps:
- name: Update label
run: |
if [[ "${{ github.event.action }}" == "auto_merge_enabled" ]]; then
gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --add-label "${{ env.LABEL_NAME }}"
elif [[ "${{ github.event.action }}" == "auto_merge_disabled" ]]; then
gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --remove-label "${{ env.LABEL_NAME }}"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6900560

Please sign in to comment.