mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 07:27:18 +01:00
38 lines
1.4 KiB
YAML
38 lines
1.4 KiB
YAML
# At the time of writing this, I'm the only maintainer and I want the proper branch protections in place
|
|
# So I'm setting up actions to auto-approve my work, since no one else does :(
|
|
# - Dominion <3
|
|
name: "Auto-Approve Dominion's PRs"
|
|
|
|
on:
|
|
pull_request_target:
|
|
branches:
|
|
- dev
|
|
- master
|
|
- V7
|
|
|
|
concurrency:
|
|
group: "approve-dominion-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
approve-pr-if-dominion-is-author:
|
|
name: Approve PR if Dominion is Author
|
|
if: github.event.pull_request.user.id == 8171642 && !github.event.pull_request.draft && !contains(github.event.pull_request.body, '- [ ]') && (github.event.pull_request.base.repo.owner.login == 'tgstation' || github.event.pull_request.base.repo.owner.login == 'Cyberboss')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Generate App Token
|
|
id: app-token-generation
|
|
uses: actions/create-github-app-token@v1
|
|
with:
|
|
app-id: ${{ secrets.APP_ID }}
|
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
|
|
- name: GitHub API Call
|
|
run: |
|
|
curl --request POST \
|
|
--url https://api.github.com/repos/${{ github.repository }}/pulls/${{github.event.number}}/reviews \
|
|
--header 'authorization: Bearer ${{ steps.app-token-generation.outputs.token }}' \
|
|
--header 'content-type: application/json' \
|
|
-d '{"event":"APPROVE"}' \
|
|
--fail
|