diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index b665c02..3453c4f 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -1,5 +1,5 @@ name: Dependabot auto-approve -on: pull_request_target +on: pull_request permissions: pull-requests: write jobs: @@ -11,9 +11,12 @@ jobs: - name: Dependabot metadata id: dependabot-metadata uses: dependabot/fetch-metadata@v1.3.0 + - name: Checkout code + uses: actions/checkout@v3 - name: Approve a PR run: | - if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" == "REVIEW_REQUIRED" ]; + gh pr status --json reviewDecision + 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 diff --git a/.github/workflows/azure-static-web-apps-orange-moss-06ebe8f10.yml b/.github/workflows/azure-static-web-apps-orange-moss-06ebe8f10.yml index 6d17759..424fa6a 100644 --- a/.github/workflows/azure-static-web-apps-orange-moss-06ebe8f10.yml +++ b/.github/workflows/azure-static-web-apps-orange-moss-06ebe8f10.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest name: Build and Deploy Job steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: Build And Deploy 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}}