Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ jobs:
&& !(github.event.head_commit.message == 'Update PolicyEngine Israel')
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repo
uses: actions/checkout@v4
with:
token: ${{ secrets.POLICYENGINE_GITHUB }}
token: ${{ steps.app-token.outputs.token }}
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand All @@ -37,6 +43,8 @@ jobs:
committer_name: Github Actions[bot]
author_name: Github Actions[bot]
message: Update PolicyEngine Israel
github_token: ${{ steps.app-token.outputs.token }}
fetch: false
Test:
runs-on: ${{ matrix.os }}
if: |
Expand Down Expand Up @@ -95,13 +103,17 @@ jobs:
(github.repository == 'PolicyEngine/policyengine-il')
&& (github.event.head_commit.message == 'Update PolicyEngine Israel')
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repo
uses: actions/checkout@v4
with:
token: ${{ secrets.POLICYENGINE_GITHUB }}
token: ${{ steps.app-token.outputs.token }}
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand All @@ -113,4 +125,5 @@ jobs:
- name: Update API
run: python .github/update_api.py
env:
GITHUB_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
1 change: 1 addition & 0 deletions changelog.d/migrate-to-app-token.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Mint GitHub App token at runtime in push workflow instead of using the expired org PAT.
Loading