Skip to content

Advent of Code

Advent of Code #1916

Workflow file for this run

name: PR
on:
pull_request_target:
types:
- opened
- ready_for_review
- synchronize
jobs:
add-labels:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/[email protected]
with:
repo-token: ${{ secrets.BOT_TOKEN }}
assign-author:
if: github.event.action == 'opened' && github.event.pull_request.user.login != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: technote-space/[email protected]
automerge-pr:
if: >
github.base_ref == 'main'
&& (
(github.event.action == 'opened' && !github.event.pull_request.draft)
|| github.event.action == 'ready_for_review')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
# If we'd use `secrets.GITHUB_TOKEN`, our CI isn't triggered on the
# merge's push event.
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
GITHUB_TOKEN: ${{ secrets.PR_AUTOMERGE_TOKEN }}
approve-dependabot-pr:
if: github.event.action == 'opened' && github.event.pull_request.user.login == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: dependabot/[email protected]
id: dependabot-metadata
- name: Approve patch and minor updates
id: approve-patch-and-minor-updates
if: (steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor') && steps.dependabot-metadata.outputs.dependency-names != '@types/vscode'
run: gh pr review "$PR_URL" --approve
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Request manual review for major updates
if: steps.approve-patch-and-minor-updates.outcome == 'skipped' && toJSON(github.event.pull_request.requested_reviewers) == '[]'
run: gh pr edit "$PR_URL" --add-reviewer JonasWanke
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}