From bc91ce97b0927da5d3b288e97f0ed23ecb9345fe Mon Sep 17 00:00:00 2001 From: Nick Evans <2616208+nickevansuk@users.noreply.github.com> Date: Fri, 22 Sep 2023 17:16:11 +0100 Subject: [PATCH] fix: ESLint --- .github/workflows/auto-approve.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/auto-approve.yml diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml new file mode 100644 index 0000000..3571026 --- /dev/null +++ b/.github/workflows/auto-approve.yml @@ -0,0 +1,30 @@ +name: Auto-approve dependabot PRs + +on: + schedule: + - cron: '*/10 * * * *' # Runs every 10 minutes + +permissions: + pull-requests: write + +jobs: + approve: + runs-on: ubuntu-latest + steps: + - name: Fetch all PRs + id: prs + run: | + prs=$(gh pr list --author 'dependabot[bot]' --json number,createdAt --label "dependencies" --state open | jq -r '.[] | select((.createdAt | fromdateiso8601) < (now - (15))) | .number') + echo "::set-output name=prs::$prs" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Approve PRs + if: steps.prs.outputs.prs != '' + run: | + for pr in ${{ steps.prs.outputs.prs }} + do + gh pr review --approve $pr + done + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}