generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
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
35fe2a9
commit 82122f9
Showing
1 changed file
with
11 additions
and
9 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 |
---|---|---|
|
@@ -79,27 +79,29 @@ jobs: | |
- name: Build project | ||
run: npm run build | ||
|
||
- name: Setup git user | ||
run: | | ||
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | ||
git config --global user.email "[email protected]" | ||
- name: Add dist | ||
run: | | ||
git add -f ./dist | ||
- name: Check if dist directory has changed | ||
id: check-dist-changes | ||
run: | | ||
before_commit="${{ github.event.before }}" | ||
if git diff --no-ignore --exit-code; then | ||
echo "dist_changed=false" >> "$GITHUB_ENV" | ||
if git diff --quiet HEAD "$before_commit" -- ./dist; then | ||
echo "No changes detected in the dist directory." | ||
else | ||
echo "dist_changed=true" >> "$GITHUB_ENV" | ||
fi | ||
- name: Setup git user | ||
run: | | ||
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | ||
git config --global user.email "[email protected]" | ||
- name: Commit dist and/or types if changed | ||
- name: Commit and push dist | ||
if: steps.check-dist-changes.outputs.dist_changed == 'true' | ||
run: | | ||
git add -f ./dist | ||
git add -f ./types | ||
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | ||
git push |