Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: Dependabot auto-approve
on: pull_request_target
on: pull_request
permissions:
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
# Checking the author will prevent your Action run failing on non-Dependabot PRs
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/[email protected]
- uses: actions/checkout@v3
- name: Approve a PR
run: |
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" == "REVIEW_REQUIRED" ];
gh pr checkout "$PR_URL"
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
then gh pr review --approve "$PR_URL"
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
fi
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/gh-pr-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Get results of `gh pr status`
on: pull_request
permissions:
pull-requests: write

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
gh pr checkout $PR_URL
BODY=$(gh pr status --json title)
gh pr comment "$PR_URL" -b "$BODY"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}