From 06a18d4f02e968255ee229703ea9cf61e37d113a Mon Sep 17 00:00:00 2001 From: Topher Lubaway Date: Tue, 9 Aug 2022 13:33:20 -0500 Subject: [PATCH] Adds PAT check to shared pr check (#15453) * Adds PAT check to shared pr check * Name change * Removes "safe_to_push" string * Adds OCTAVIA_PAT and uses the found PAT found PAT was not used in all locales, so this could have still failed on an expired OCTAVIA_PAT before this change --- .github/workflows/shared-pulls.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shared-pulls.yml b/.github/workflows/shared-pulls.yml index d5635e2769a8..df9c11d6b49a 100644 --- a/.github/workflows/shared-pulls.yml +++ b/.github/workflows/shared-pulls.yml @@ -4,13 +4,35 @@ on: types: [opened, labeled, unlabeled, ready_for_review, synchronize, reopened] jobs: + find_valid_pat: + name: "Find a PAT with room for actions" + timeout-minutes: 10 + runs-on: ubuntu-latest + outputs: + pat: ${{ steps.variables.outputs.pat }} + steps: + - name: Checkout Airbyte + uses: actions/checkout@v2 + - name: Check PAT rate limits + id: variables + run: | + ./tools/bin/find_non_rate_limited_PAT \ + ${{ secrets.OCTAVIA_PAT }} \ + ${{ secrets.AIRBYTEIO_PAT }} \ + ${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \ + ${{ secrets.SUPERTOPHER_PAT }} \ + ${{ secrets.DAVINCHIA_PAT }} + shared-pulls: + name: "Label github issues for tracking" + needs: + - find_valid_pat runs-on: ubuntu-latest steps: - uses: nick-fields/private-action-loader@v3 with: - pal-repo-token: "${{ secrets.OCTAVIA_PAT }}" + pal-repo-token: ${{ needs.find_valid_pat.outputs.pat }} pal-repo-name: airbytehq/workflow-actions@production # the following input gets passed to the private action - token: "${{ secrets.OCTAVIA_PAT }}" + token: ${{ needs.find_valid_pat.outputs.pat }} command: "pull"