Skip to content

Commit

Permalink
fix(ci): Allow release-please to run as full bot account
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpovel committed Jan 1, 2024
1 parent b9c38d6 commit 2fcafa2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ jobs:
- name: Run type checks
run: devbox run typecheck

# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
- name: Fetch GitHub token for integration tests
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Run tests
run: devbox run test
env:
Expand All @@ -37,9 +45,7 @@ jobs:
# The `GITHUB_TOKEN` failed (https://github.com/alexpovel/ancv/actions/runs/4093416643/jobs/7063406195):
#
# body = b'{"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/reference/gists#list-gists-for-a-user"}'
#
# So use a personal token.
GH_TOKEN: ${{ secrets.GH_PERMISSIONLESS_FGAT }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -69,8 +75,17 @@ jobs:
tag_name: ${{ steps.release.outputs.tag_name }}

steps:
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: google-github-actions/release-please-action@v4
id: release
with:
# Token needs: `contents: write`, `pull-requests: write`
token: ${{ steps.app-token.outputs.token }}

publish:
name: Publish to PyPI
Expand Down

0 comments on commit 2fcafa2

Please sign in to comment.