Update Inventory #671
This file contains hidden or 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
name: Update Inventory | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '00 4 * * 1-5' | |
jobs: | |
update-nodejs-inventory: | |
name: Update Node.js Engine Inventory | |
runs-on: pub-hk-ubuntu-24.04-ip | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Install Rust Inventory Binaries | |
run: cargo install heroku-nodejs-utils --bin update_node_inventory --git https://github.com/heroku/buildpacks-nodejs | |
- name: Rebuild Inventory | |
id: rebuild-inventory | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
{ | |
echo "msg<<${delimiter}" | |
update_node_inventory ./inventory/node.toml ./CHANGELOG.md --platform linux-x64 --format classic | |
echo "${delimiter}" | |
} >> $GITHUB_OUTPUT | |
- uses: actions/create-github-app-token@v2 | |
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/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
title: "Update Node.js Engine Inventory" | |
commit-message: "Update Inventory for heroku/nodejs-engine\n\n${{ steps.rebuild-inventory.outputs.msg }}" | |
branch: update-nodejs-inventory | |
body: "Automated pull-request to update heroku/nodejs-engine inventory:\n\n${{ steps.rebuild-inventory.outputs.msg }}" | |
committer: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}> | |
author: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}> | |
- name: Configure PR | |
if: steps.pr.outputs.pull-request-operation == 'created' | |
run: gh pr merge --squash --auto "${{ steps.pr.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ steps.generate-token.outputs.token }} |