-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28a8aa9
commit e49ac4f
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Commit Changes | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-commit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js environment | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Build project using Webpack/Rollup | ||
run: | | ||
npm i | ||
npm run build | ||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "actions@github.com" | ||
git add -A | ||
git reset -- node_modules # Unstage the node_modules changes | ||
if ! git diff --cached --quiet; then | ||
git diff --cached --name-only | while read -r file; do | ||
commit_message="Updated $file :inbox_tray:" | ||
git commit -m "$commit_message" -- "$file" | ||
done | ||
git push | ||
else | ||
echo "No changes to commit." | ||
fi |