-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (99 loc) · 4.39 KB
/
inventory.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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: 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: |
delimiter="$(openssl rand -hex 8)"
{
echo "msg<<${delimiter}"
diff_versions node inventory/node.toml
echo "${delimiter}"
} >> $GITHUB_OUTPUT
- 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/## \[Unreleased\]\s+/## \[Unreleased\]\n\n{}/' CHANGELOG.md
- 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: Create Pull Request
id: pr
uses: peter-evans/[email protected]
with:
token: ${{ steps.generate-token.outputs.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
body: "Automated pull-request to update heroku/nodejs engine inventory:\n\n${{ steps.set-diff-msg.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 }}
update-yarn-inventory:
name: Update Node.js Yarn Inventory
runs-on: pub-hk-ubuntu-24.04-ip
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- 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: |
delimiter="$(openssl rand -hex 8)"
{
echo "msg<<${delimiter}"
diff_versions yarn inventory/yarn.toml
echo "${delimiter}"
} >> $GITHUB_OUTPUT
- 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/## \[Unreleased\]\s+/## \[Unreleased\]\n\n{}/' CHANGELOG.md
- 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: Create Pull Request
id: pr
uses: peter-evans/[email protected]
with:
token: ${{ steps.generate-token.outputs.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
body: "Automated pull-request to update heroku/nodejs yarn inventory:\n\n${{ steps.set-diff-msg.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 }}