Skip to content

Commit 0c73b70

Browse files
authored
find_non_rate_limited_PAT (#19736)
* find_non_rate_limited_PAT * checkout repo to find pat
1 parent cc6facf commit 0c73b70

8 files changed

+251
-184
lines changed

.github/workflows/gke-kube-test-command.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,10 @@ on:
1717
required: false
1818

1919
jobs:
20-
find_valid_pat:
21-
name: "Find a PAT with room for actions"
22-
timeout-minutes: 10
23-
runs-on: ubuntu-latest
24-
outputs:
25-
pat: ${{ steps.variables.outputs.pat }}
26-
steps:
27-
- name: Checkout Airbyte
28-
uses: actions/checkout@v3
29-
- name: Check PAT rate limits
30-
id: variables
31-
run: |
32-
./tools/bin/find_non_rate_limited_PAT \
33-
${{ secrets.AIRBYTEIO_PAT }} \
34-
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
35-
${{ secrets.SUPERTOPHER_PAT }} \
36-
${{ secrets.DAVINCHIA_PAT }}
3720
start-gke-kube-acceptance-test-runner:
3821
timeout-minutes: 10
3922
name: Start GKE Kube Acceptance Test EC2 Runner
4023
runs-on: ubuntu-latest
41-
needs: find_valid_pat
4224
outputs:
4325
label: ${{ steps.start-ec2-runner.outputs.label }}
4426
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
@@ -48,13 +30,20 @@ jobs:
4830
with:
4931
repository: ${{ github.event.inputs.repo }}
5032
ref: ${{ github.event.inputs.gitref }}
33+
- name: Check PAT rate limits
34+
run: |
35+
./tools/bin/find_non_rate_limited_PAT \
36+
${{ secrets.AIRBYTEIO_PAT }} \
37+
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
38+
${{ secrets.SUPERTOPHER_PAT }} \
39+
${{ secrets.DAVINCHIA_PAT }}
5140
- name: Start AWS Runner
5241
id: start-ec2-runner
5342
uses: ./.github/actions/start-aws-runner
5443
with:
5544
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
5645
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
57-
github-token: ${{ needs.find_valid_pat.outputs.pat }}
46+
github-token: ${{ env.PAT }}
5847
gke-kube-acceptance-test:
5948
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
6049
needs: start-gke-kube-acceptance-test-runner # required to start the main job when the runner is ready
@@ -146,7 +135,6 @@ jobs:
146135
needs:
147136
- start-gke-kube-acceptance-test-runner # required to get output from the start-runner job
148137
- gke-kube-acceptance-test # required to wait when the main job is done
149-
- find_valid_pat
150138
runs-on: ubuntu-latest
151139
if: ${{ always() }}
152140
steps:
@@ -156,10 +144,22 @@ jobs:
156144
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
157145
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
158146
aws-region: us-east-2
147+
- name: Checkout Airbyte
148+
uses: actions/checkout@v3
149+
with:
150+
repository: ${{ github.event.inputs.repo }}
151+
ref: ${{ github.event.inputs.gitref }}
152+
- name: Check PAT rate limits
153+
run: |
154+
./tools/bin/find_non_rate_limited_PAT \
155+
${{ secrets.AIRBYTEIO_PAT }} \
156+
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
157+
${{ secrets.SUPERTOPHER_PAT }} \
158+
${{ secrets.DAVINCHIA_PAT }}
159159
- name: Stop EC2 runner
160160
uses: supertopher/[email protected]
161161
with:
162162
mode: stop
163-
github-token: ${{ needs.find_valid_pat.outputs.pat }}
163+
github-token: ${{ env.PAT }}
164164
label: ${{ needs.start-gke-kube-acceptance-test-runner.outputs.label }}
165165
ec2-instance-id: ${{ needs.start-gke-kube-acceptance-test-runner.outputs.ec2-instance-id }}

0 commit comments

Comments
 (0)