From 2165b9a4dec93d064e5f7e5806928e4f517ce2ad Mon Sep 17 00:00:00 2001 From: Salah Al Saleh Date: Sun, 7 Jan 2024 17:26:39 +0000 Subject: [PATCH] Use GITHUB_TOKEN for Automated PRs Manager github action --- .github/workflows/automated-prs-manager.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automated-prs-manager.yaml b/.github/workflows/automated-prs-manager.yaml index b898dcebbe..3435f41f85 100644 --- a/.github/workflows/automated-prs-manager.yaml +++ b/.github/workflows/automated-prs-manager.yaml @@ -10,14 +10,14 @@ jobs: runs-on: ubuntu-latest outputs: prs: ${{ steps.list-prs.outputs.prs }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v4 - name: List PRs id: list-prs - env: - GH_TOKEN: ${{ secrets.NIGHTLY_GH_PAT }} run: | set -euo pipefail @@ -48,6 +48,8 @@ jobs: pr: ${{ fromJson(needs.list-prs.outputs.prs) }} fail-fast: false max-parallel: 1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v4 @@ -55,8 +57,6 @@ jobs: ref: ${{ matrix.pr.headRefName }} - name: Process PR - env: - GH_TOKEN: ${{ secrets.NIGHTLY_GH_PAT }} run: | set -euo pipefail @@ -82,6 +82,7 @@ jobs: echo -e "LGTM :thumbsup: \n\nThis PR was automatically approved and merged by the [automated-prs-manager](https://github.com/replicatedhq/kots/blob/main/.github/workflows/automated-prs-manager.yaml) GitHub action" > body.txt gh pr review --approve "${{ matrix.pr.url }}" --body-file body.txt gh pr merge --auto --squash "${{ matrix.pr.url }}" + sleep 10 exit 0 else echo "All tests passed, but some required PR checks have not. Skipping."