Skip to content

Commit

Permalink
use refactored find a pat script that writes token to env (not base64…
Browse files Browse the repository at this point in the history
… encoded) (#16321)
  • Loading branch information
Tim Chan committed Sep 6, 2022
1 parent 4653af2 commit a4621f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/slash-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,29 @@ jobs:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2

- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
- name: Get PR repo and ref
id: getref
run: |
pr_info="$(curl ${{ github.event.issue.pull_request.url }})"
echo ::set-output name=ref::"$(echo $pr_info | jq -r '.head.ref')"
echo ::set-output name=repo::"$(echo $pr_info | jq -r '.head.repo.full_name')"
- name: Slash Command Dispatch
id: scd
uses: peter-evans/slash-command-dispatch@v2
with:
token: ${{ secrets.SUPERTOPHER_PAT }}
token: ${{ env.PAT }}
commands: |
test
test-performance
Expand All @@ -34,6 +46,7 @@ jobs:
gitref=${{ steps.getref.outputs.ref }}
comment-id=${{ github.event.comment.id }}
dispatch-type: workflow

- name: Edit comment with error message
if: steps.scd.outputs.error-message
uses: peter-evans/create-or-update-comment@v1
Expand Down
1 change: 1 addition & 0 deletions tools/bin/find_non_rate_limited_PAT
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ for personal_access_token in $@
echo -e "$blue_text""Found a good PAT!!""$default_text"
# ::set-output name is a github action magic string for output
echo "::set-output name=pat::$base64_valid_pat"
echo "PAT=$personal_access_token" >> $GITHUB_ENV
exit 0
else
echo -e "$red_text""Rate limit exceed for this PAT!""$default_text"
Expand Down

0 comments on commit a4621f8

Please sign in to comment.