-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generates a token from a GitHub app that can be used in automation tasks that create pull requests.
- Loading branch information
1 parent
562a3fc
commit 56a3fd0
Showing
1 changed file
with
25 additions
and
0 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 |
---|---|---|
|
@@ -24,14 +24,27 @@ jobs: | |
run: "generate_inventory node > inventory/node.toml" | ||
- name: Update Changelog | ||
run: echo "${{ steps.set-diff-msg.outputs.msg }}" | xargs -r -I '{}' perl -i -p -e 's/## main\s+/## main\n\n{}/' CHANGELOG.md | ||
- uses: heroku/use-app-token-action@main | ||
id: generate-token | ||
with: | ||
app_id: ${{ vars.LINGUIST_GH_APP_ID }} | ||
private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | ||
- name: Create Pull Request | ||
id: pr | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
title: "Update Node.js Engine Inventory" | ||
commit-message: "Update Inventory for heroku/nodejs engine\n\n${{ steps.set-diff-msg.outputs.msg }}" | ||
branch: update-nodejs-inventory | ||
labels: "automation" | ||
body: "Automated pull-request to update heroku/nodejs engine inventory:\n\n${{ steps.set-diff-msg.outputs.msg }}" | ||
- name: Configure PR | ||
if: steps.pr.outputs.pull-request-operation == 'created' | ||
run: gh pr merge --auto "${{ steps.pr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }} | ||
|
||
update-yarn-inventory: | ||
name: Update Node.js Yarn Inventory | ||
runs-on: pub-hk-ubuntu-22.04-small | ||
|
@@ -52,11 +65,23 @@ jobs: | |
run: "generate_inventory yarn > inventory/yarn.toml" | ||
- name: Update Changelog | ||
run: echo "${{ steps.set-diff-msg.outputs.msg }}" | xargs -r -I '{}' perl -i -p -e 's/## main\s+/## main\n\n{}/' CHANGELOG.md | ||
- uses: heroku/use-app-token-action@main | ||
id: generate-token | ||
with: | ||
app_id: ${{ vars.LINGUIST_GH_APP_ID }} | ||
private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | ||
- name: Create Pull Request | ||
id: pr | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ steps.generate-token.outputs.app_token }} | ||
title: "Update Node.js Yarn Inventory" | ||
commit-message: "Update Inventory for heroku/nodejs yarn\n\n${{ steps.set-diff-msg.outputs.msg }}" | ||
branch: update-yarn-inventory | ||
labels: "automation" | ||
body: "Automated pull-request to update heroku/nodejs yarn inventory:\n\n${{ steps.set-diff-msg.outputs.msg }}" | ||
- name: Configure PR | ||
if: steps.pr.outputs.pull-request-operation == 'created' | ||
run: gh pr merge --auto "${{ steps.pr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }} |