Skip to content

Update Inventory

Update Inventory #701

Workflow file for this run

name: Update Inventory
on:
workflow_dispatch:
schedule:
- cron: '00 4 * * 1-5'
jobs:
update-nodejs-inventory:
name: Update Node.js Inventory
runs-on: pub-hk-ubuntu-24.04-ip
steps:
- 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 }}
- name: Checkout Repo
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust cache
uses: Swatinem/[email protected]
- name: Rebuild Inventory
id: rebuild-inventory
run: |
delimiter="$(openssl rand -hex 8)"
{
echo "msg<<${delimiter}"
cargo run --bin update_node_inventory buildpacks/nodejs-engine/inventory.toml buildpacks/nodejs-engine/CHANGELOG.md
echo "${delimiter}"
} >> $GITHUB_OUTPUT
- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
title: "Update Node.js Inventory"
commit-message: "Update Inventory for heroku/nodejs\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 }}>
branch: update-nodejs-inventory
body: "Automated pull-request to update heroku/nodejs inventory:\n\n${{ steps.rebuild-inventory.outputs.msg }}"
- name: Configure PR
if: steps.pr.outputs.pull-request-operation == 'created'
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: gh pr merge --squash --auto "${{ steps.pr.outputs.pull-request-number }}"
update-yarn-inventory:
name: Yarn
uses: ./.github/workflows/_update-inventory.yml
with:
name: Yarn
distribution: yarn
buildpack_id: heroku/nodejs-yarn
buildpack_path: buildpacks/nodejs-yarn
secrets: inherit
update-npm-inventory:
name: npm
uses: ./.github/workflows/_update-inventory.yml
with:
name: NPM
distribution: npm
buildpack_id: heroku/nodejs-npm-engine
buildpack_path: buildpacks/nodejs-npm-engine
secrets: inherit