mirror of
https://github.com/h5bp/html5-boilerplate.git
synced 2026-01-08 06:13:53 -05:00
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>
This commit is contained in:
47
.github/workflows/build-dist.yml
vendored
Normal file
47
.github/workflows/build-dist.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Build and PR dist changes
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-pr-dist:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build project
|
||||
run: npm run build
|
||||
|
||||
- name: Check for dist changes
|
||||
id: git-diff
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add dist
|
||||
if git diff --cached --quiet; then
|
||||
echo "changed=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create Pull Request for dist changes
|
||||
if: steps.git-diff.outputs.changed == 'true'
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
with:
|
||||
commit-message: "chore(dist): update dist folder after build"
|
||||
title: "chore(dist): update dist folder after build"
|
||||
body: "This PR updates the dist folder with the latest build output."
|
||||
branch: update-dist-after-build
|
||||
add-paths: dist
|
||||
Reference in New Issue
Block a user