Skip to content

Commit

Permalink
Use GITHUB_TOKEN instead of PAT in "Slash Command Dispatch" and "GMT …
Browse files Browse the repository at this point in the history
…Dev Tests" workflows (#2950)
  • Loading branch information
seisman authored Jan 4, 2024
1 parent 8be628e commit 03f66b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,22 @@ jobs:
# fetch all history so that setuptools-scm works
fetch-depth: 0

# Generate token from GenericMappingTools bot
- name: Generate token from GenericMappingTools bot
uses: tibdex/github-app-token@v2
if: github.event_name == 'repository_dispatch'
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

# Checkout the pull request branch
- name: Checkout
uses: actions/[email protected]
if: github.event_name == 'repository_dispatch'
with:
token: ${{ steps.generate-token.outputs.token }}
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
# fetch all history so that setuptools-scm works
fetch-depth: 0

- name: Show job URL
uses: peter-evans/[email protected]
if: github.event_name == 'repository_dispatch' && (matrix.os == 'ubuntu-latest')
if: github.event_name == 'repository_dispatch' && runner.os == 'Linux'
with:
token: ${{ steps.generate-token.outputs.token }}
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/slash-command-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ jobs:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
# Generate token from GenericMappingTools bot
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v3
with:
token: ${{ steps.generate-token.outputs.token }}
token: ${{ secrets.GITHUB_TOKEN }}
commands: |
format
test-gmt-dev
Expand Down

0 comments on commit 03f66b5

Please sign in to comment.