From 82671af50b8f2f8e04c107ff93716b9cb3e9b53d Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Fri, 11 Mar 2022 22:03:36 -0600 Subject: [PATCH 01/16] adding --- .github/workflows/gh-pr-status.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/gh-pr-status.yml diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml new file mode 100644 index 0000000..b1b512a --- /dev/null +++ b/.github/workflows/gh-pr-status.yml @@ -0,0 +1,15 @@ +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: | + BODY=$(gh pr status --json reviewDecision) + gh pr comment "$PR_URL" -b $BODY + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} From 6d5d19797b7233a53681fb356bd6edb14f3ccad6 Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Fri, 11 Mar 2022 22:07:38 -0600 Subject: [PATCH 02/16] trying author --- .github/workflows/gh-pr-status.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index b1b512a..6b6cb41 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: | - BODY=$(gh pr status --json reviewDecision) + BODY=$(gh pr status --json author) gh pr comment "$PR_URL" -b $BODY env: PR_URL: ${{github.event.pull_request.html_url}} From 77141d4c7450dd4d34795077ba3ea532d95162b5 Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Fri, 11 Mar 2022 22:08:54 -0600 Subject: [PATCH 03/16] bumping --- .github/workflows/gh-pr-status.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index 6b6cb41..d60aadd 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -13,3 +13,4 @@ jobs: env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + From 816421907e075ffa739e211468085148af0c7a3f Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Fri, 11 Mar 2022 22:10:57 -0600 Subject: [PATCH 04/16] trying "title" --- .github/workflows/gh-pr-status.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index d60aadd..36cc071 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: | - BODY=$(gh pr status --json author) + BODY=$(gh pr status --json title) gh pr comment "$PR_URL" -b $BODY env: PR_URL: ${{github.event.pull_request.html_url}} From 85c7454b070f73038b6bf7f1f0684f1e66910a1b Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 21:50:02 -0500 Subject: [PATCH 05/16] checking out by url explicitly --- .github/workflows/gh-pr-status.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index 36cc071..e2e2c74 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -6,8 +6,8 @@ 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: From 0f6551a1f5bc804b0730debd387a002a2880784c Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 21:54:04 -0500 Subject: [PATCH 06/16] trying again --- .github/workflows/gh-pr-status.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index e2e2c74..c5e0148 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -6,6 +6,7 @@ jobs: run: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - run: | gh pr checkout $PR_URL BODY=$(gh pr status --json title) From 9d775c0a70b5050e18ee342d30656ea928640482 Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 21:55:01 -0500 Subject: [PATCH 07/16] fixing --- .github/workflows/gh-pr-status.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index c5e0148..06d9e2c 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -10,7 +10,7 @@ jobs: - run: | gh pr checkout $PR_URL BODY=$(gh pr status --json title) - gh pr comment "$PR_URL" -b $BODY + gh pr comment "$PR_URL" -b "$BODY" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} From 1f7e832582c517775292e0095f533bf6ea5b3884 Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 21:57:03 -0500 Subject: [PATCH 08/16] testing --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index b665c02..24ab602 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -6,13 +6,13 @@ 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/fetch-metadata@v1.3.0 - name: Approve a PR run: | + gh pr checkout "$PR_URL" if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" == "REVIEW_REQUIRED" ]; then gh pr review --approve "$PR_URL" else echo "PR already approved, skipping additional approvals to minimize emails/notification noise."; From 68c8448d79cab600a90128b97538a42c7736bf1d Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 21:58:49 -0500 Subject: [PATCH 09/16] bumping --- .github/workflows/auto-approve.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 24ab602..a868b99 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -1,11 +1,10 @@ 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 steps: - name: Dependabot metadata id: dependabot-metadata From 89bd0379fa0883e7fa16a4f686ac266e1bb9d52a Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 21:59:09 -0500 Subject: [PATCH 10/16] bumping again --- .github/workflows/gh-pr-status.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index 06d9e2c..9698887 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -2,6 +2,7 @@ name: Get results of `gh pr status` on: pull_request permissions: pull-requests: write + jobs: run: runs-on: ubuntu-latest From 0421c4b457044577bddc32628d1046e644fb1054 Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 21:59:50 -0500 Subject: [PATCH 11/16] fixing --- .github/workflows/auto-approve.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index a868b99..27b0dba 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -6,9 +6,6 @@ jobs: dependabot: runs-on: ubuntu-latest steps: - - name: Dependabot metadata - id: dependabot-metadata - uses: dependabot/fetch-metadata@v1.3.0 - name: Approve a PR run: | gh pr checkout "$PR_URL" From 4a0c431d2cde8b05284c8be422f3da2a45c476ca Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 22:00:04 -0500 Subject: [PATCH 12/16] bumping --- .github/workflows/gh-pr-status.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index 9698887..06d9e2c 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -2,7 +2,6 @@ name: Get results of `gh pr status` on: pull_request permissions: pull-requests: write - jobs: run: runs-on: ubuntu-latest From f40a06c4865cac91df9957c7f17963edfb0dabc3 Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 22:01:12 -0500 Subject: [PATCH 13/16] fixing --- .github/workflows/auto-approve.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 27b0dba..7499df3 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -6,6 +6,7 @@ jobs: dependabot: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - name: Approve a PR run: | gh pr checkout "$PR_URL" From adc4ca94b3179ca508afc48b5f27199e23eaffaa Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 22:01:34 -0500 Subject: [PATCH 14/16] bumping again --- .github/workflows/gh-pr-status.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gh-pr-status.yml b/.github/workflows/gh-pr-status.yml index 06d9e2c..9698887 100644 --- a/.github/workflows/gh-pr-status.yml +++ b/.github/workflows/gh-pr-status.yml @@ -2,6 +2,7 @@ name: Get results of `gh pr status` on: pull_request permissions: pull-requests: write + jobs: run: runs-on: ubuntu-latest From 4286c3d41b940c292109c69f54f2e02e7e39a72a Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 22:03:21 -0500 Subject: [PATCH 15/16] fixing --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 7499df3..1c26a72 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -10,7 +10,7 @@ jobs: - name: Approve a PR run: | gh pr checkout "$PR_URL" - if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" == "REVIEW_REQUIRED" ]; + 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 From 73279fa385b47e09b4f56ce70bc8f4d02a3e3f63 Mon Sep 17 00:00:00 2001 From: Michael Waddell Date: Sat, 26 Mar 2022 22:04:13 -0500 Subject: [PATCH 16/16] bumping --- .github/workflows/auto-approve.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 1c26a72..b1d4e8c 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -2,6 +2,7 @@ name: Dependabot auto-approve on: pull_request permissions: pull-requests: write + jobs: dependabot: runs-on: ubuntu-latest