-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use actions/create-github-app-token instead of heroku/use-app-token (#…
…222) * Use actions/create-github-app-token instead of heroku/use-app-token The use-app-token action is deprecated: heroku/use-app-token-action#17 GUS-W-15886232 * Grant heroku/cnb-builder-images access for generated token in update-builder action It needs cross-repo access permissions (runs on a CNB repo, but needs to update the builder repo).
- Loading branch information
Showing
4 changed files
with
30 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,18 +58,18 @@ jobs: | |
runs-on: ${{ inputs.ip_allowlisted_runner }} | ||
steps: | ||
- name: Get token for GH application (Linguist) | ||
uses: heroku/use-app-token-action@main | ||
uses: actions/create-github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ inputs.app_id }} | ||
private_key: ${{ secrets.app_private_key }} | ||
app-id: ${{ inputs.app_id }} | ||
private-key: ${{ secrets.app_private_key }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Using the GH application token here will configure the local git config for this repo with credentials | ||
# that can be used to make signed commits that are attributed to the GH application user | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Install Languages CLI | ||
uses: heroku/languages-github-actions/.github/actions/install-languages-cli@main | ||
|
@@ -92,7 +92,7 @@ jobs: | |
id: pr | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
title: Prepare release v${{ steps.prepare.outputs.to_version }} | ||
body: ${{ steps.generate-changelog.outputs.changelog }} | ||
commit-message: | | ||
|
@@ -109,4 +109,4 @@ jobs: | |
if: steps.pr.outputs.pull-request-operation == 'created' | ||
run: gh pr merge --auto --squash "${{ steps.pr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }} | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,23 +307,23 @@ jobs: | |
done | ||
- name: Get token for GitHub application (Linguist) | ||
uses: heroku/use-app-token-action@main | ||
uses: actions/create-github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ inputs.app_id }} | ||
private_key: ${{ secrets.app_private_key }} | ||
app-id: ${{ inputs.app_id }} | ||
private-key: ${{ secrets.app_private_key }} | ||
|
||
- name: Check if release exists | ||
id: check | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }} | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
run: echo "published_to_github=$(gh release view v${{ needs.compile.outputs.version }} -R ${{ github.repository }} &> /dev/null && echo "true" || echo "false")" >> $GITHUB_OUTPUT | ||
|
||
- name: Create GitHub Release | ||
if: inputs.dry_run == false && steps.check.outputs.published_to_github == 'false' | ||
uses: softprops/[email protected] | ||
with: | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
tag_name: v${{ needs.compile.outputs.version }} | ||
body: ${{ needs.compile.outputs.changelog }} | ||
files: "*.cnb" | ||
|
@@ -370,11 +370,12 @@ jobs: | |
runs-on: ${{ inputs.ip_allowlisted_runner }} | ||
steps: | ||
- name: Get token for GH application (Linguist) | ||
uses: heroku/use-app-token-action@main | ||
uses: actions/create-github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ inputs.app_id }} | ||
private_key: ${{ secrets.app_private_key }} | ||
app-id: ${{ inputs.app_id }} | ||
private-key: ${{ secrets.app_private_key }} | ||
repositories: heroku/cnb-builder-images | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -388,7 +389,7 @@ jobs: | |
path: ./cnb-builder-images | ||
# Using the GH application token here will configure the local git config for this repo with credentials | ||
# that can be used to make signed commits that are attributed to the GH application user | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Install crane | ||
uses: buildpacks/github-actions/[email protected] | ||
|
@@ -409,7 +410,7 @@ jobs: | |
id: pr | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
title: Update ${{ github.repository }} to v${{ needs.compile.outputs.version }} | ||
body: ${{ needs.compile.outputs.changelog }} | ||
commit-message: | | ||
|
@@ -427,4 +428,4 @@ jobs: | |
if: steps.pr.outputs.pull-request-operation == 'created' | ||
run: gh pr merge --auto --squash --repo heroku/cnb-builder-images "${{ steps.pr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }} | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,13 +24,13 @@ jobs: | |
# workflows (such as CI) won't automatically run on any PRs opened by this workflow: | ||
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow | ||
- name: Generate access token for Linguist GitHub App | ||
uses: heroku/use-app-token-action@main | ||
uses: actions/create-github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ vars.LINGUIST_GH_APP_ID }} | ||
app-id: ${{ vars.LINGUIST_GH_APP_ID }} | ||
# Note: The calling workflow must enable secrets inheritance for this variable to be accessible: | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsecretsinherit | ||
private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | ||
private-key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -42,7 +42,7 @@ jobs: | |
# Force a full clone, otherwise fetch-tags doesn't actually fetch any tags: | ||
# https://github.com/actions/checkout/issues/1471 | ||
fetch-depth: 0 | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Determine existing tagged version | ||
id: existing-version | ||
|
@@ -86,7 +86,7 @@ jobs: | |
id: pr | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
title: Prepare release v${{ steps.new-version.outputs.version }} | ||
body: | | ||
Commits since the last release: | ||
|
@@ -107,4 +107,4 @@ jobs: | |
if: steps.pr.outputs.pull-request-operation == 'created' | ||
run: gh pr merge --auto --squash "${{ steps.pr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }} | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,18 +29,18 @@ jobs: | |
runs-on: pub-hk-ubuntu-22.04-small | ||
steps: | ||
- name: Get token for GH application (Linguist) | ||
uses: heroku/use-app-token-action@main | ||
uses: actions/create-github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ vars.LINGUIST_GH_APP_ID }} | ||
private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | ||
app-id: ${{ vars.LINGUIST_GH_APP_ID }} | ||
private-key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Using the GH application token here will configure the local git config for this repo with credentials | ||
# that can be used to make signed commits that are attributed to the GH application user | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
# This will ensure commits made from this workflow are attributed to the GH application user | ||
- name: Configure git | ||
|
@@ -61,7 +61,7 @@ jobs: | |
id: previous-version | ||
run: echo "value=$(gh release view --json tagName --jq '.tagName' | sed 's/^v//')" >> $GITHUB_OUTPUT | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }} | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Bump version | ||
run: | | ||
|
@@ -122,7 +122,7 @@ jobs: | |
- name: Create release | ||
uses: softprops/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.app_token }} | ||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
with: | ||
target_commitish: ${{ steps.release-tag.outputs.sha }} | ||
tag_name: v${{ steps.metadata.outputs.version }} | ||
|