Skip to content

Commit b99ebd6

Browse files
roblarsencoliff
andauthored
Updating dist via GitHub Actions and an automated PR (#3282)
* trying this a different way! * Update GitHub Actions to use specific commit SHAs Changed actions/checkout and actions/setup-node to reference specific commit SHAs for improved security and reproducibility. Also set 'persist-credentials' to false for checkout. --------- Co-authored-by: Christian Oliff <christian_oliff@trimble.com>
1 parent 94f79e4 commit b99ebd6

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/build-dist.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and PR dist changes
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build-and-pr-dist:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
13+
with:
14+
persist-credentials: false
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
18+
with:
19+
node-version: "lts/*"
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build project
25+
run: npm run build
26+
27+
- name: Check for dist changes
28+
id: git-diff
29+
run: |
30+
git config --global user.name "github-actions[bot]"
31+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
32+
git add dist
33+
if git diff --cached --quiet; then
34+
echo "changed=false" >> $GITHUB_OUTPUT
35+
else
36+
echo "changed=true" >> $GITHUB_OUTPUT
37+
fi
38+
39+
- name: Create Pull Request for dist changes
40+
if: steps.git-diff.outputs.changed == 'true'
41+
uses: peter-evans/create-pull-request@v6
42+
with:
43+
commit-message: "chore(dist): update dist folder after build"
44+
title: "chore(dist): update dist folder after build"
45+
body: "This PR updates the dist folder with the latest build output."
46+
branch: update-dist-after-build
47+
add-paths: dist

0 commit comments

Comments
 (0)