Skip to content

Update Inventory

Update Inventory #118

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 Engine Inventory
runs-on: pub-hk-ubuntu-22.04-small
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Rust Inventory Binaries
run: cargo install heroku-nodejs-utils --bin diff_versions --bin generate_inventory --git https://github.com/heroku/buildpacks-nodejs
- id: set-diff-msg
name: Set Diff Message
run: echo "::set-output name=msg::$(diff_versions node inventory/node.toml)"
- name: Rebuild Inventory
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/create-pull-request@v5.0.2
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 --squash --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
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- id: install-rust-toolchain
name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Rust Inventory Binaries
run: cargo install heroku-nodejs-utils --bin diff_versions --bin generate_inventory --git https://github.com/heroku/buildpacks-nodejs
- id: set-diff-msg
name: Set Diff Message
run: echo "::set-output name=msg::$(diff_versions yarn inventory/yarn.toml)"
- name: Rebuild Inventory
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/create-pull-request@v5.0.2
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 --squash --auto "${{ steps.pr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }}