Skip to content

Show progress indicator in terminal #55

Show progress indicator in terminal

Show progress indicator in terminal #55

name: Approve command
on:
issue_comment:
types: [ created ]
workflow_dispatch:
inputs:
issue_number:
description: Issue number
required: true
type: number
jobs:
approve-issue:
runs-on: ubuntu-latest
timeout-minutes: 5
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment
if: ${{ ! github.event.issue.pull_request && (github.event.comment.body == '/approve' && github.event.comment.author_association == 'MEMBER' || inputs.issue_number != '') }}
permissions:
issues: write
steps:
- run: |
gh issue edit \
${{ inputs.issue_number != '' && inputs.issue_number || github.event.issue.number }} \
--add-label "state: approved" \
--remove-label "state: in review"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
approve-pr:
runs-on: ubuntu-latest
timeout-minutes: 5
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment
if: ${{ github.event.issue.pull_request && (github.event.comment.body == '/approve' && github.event.comment.author_association == 'MEMBER' || inputs.issue_number != '') }}
permissions:
pull-requests: write
# https://github.com/cli/cli/issues/6274
repository-projects: read
steps:
- run: |
gh pr review \
${{ inputs.issue_number != '' && inputs.issue_number || github.event.pull_request.number }} \
--approve
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}