Skip to content

Commit c9570cd

Browse files
authored
Automate dist update in dependabot PRs (#437)
- Automate workflow to build package and add changes to PR. - Only runs on PRs started by user dependabot[bot].
1 parent eb77ba9 commit c9570cd

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update dist on Dependabot PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches: [main]
7+
8+
jobs:
9+
build-and-commit:
10+
if: github.actor == 'dependabot[bot]'
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.head_ref }}
22+
23+
- name: Set up Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20.x
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build package
32+
run: npm run package
33+
34+
- name: Commit dist changes
35+
run: |
36+
git config user.name "github-actions[bot]"
37+
git config user.email "github-actions[bot]@users.noreply.github.com"
38+
git add dist
39+
if git diff --cached --quiet; then
40+
echo "No changes to commit."
41+
else
42+
git commit -m "Update dist after Dependabot update"
43+
git push
44+
fi

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ Not available.
138138
139139
## Known Limitations
140140
141-
This action is very slow, especially on Windows, see issue [#36][issue-36-link].
141+
This action can be slow, especially on Windows, see issue [#36][issue-36-link].
142+
142143
- Macos runners are not supported, because OpenModelica discontinued the Mac
143144
builds after version 1.16. It should be possible to build/install latest
144145
OpenModelica nightly for macOS, see [this README][macos-readme]:.
@@ -151,8 +152,8 @@ The tests will install all sorts of OpenModelica versions and tools. To prevent
151152
the installer from messing with your host system use the provided dockerfile or
152153
dev-container:
153154
154-
- Linux: [.devcontainer/devcontainer.json](.devcontainer/devcontainer.json)
155-
- Windows: [.ci/dockerfile](.ci/dockerfile)
155+
- Linux: [.devcontainer/devcontainer.json](.devcontainer/devcontainer.json)
156+
- Windows: [.ci/dockerfile](.ci/dockerfile)
156157
157158
To build and test run:
158159

0 commit comments

Comments
 (0)