Updating dist
via GitHub Actions and an automated PR (#3282)
#1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |