Skip to content

Commit 1f63b89

Browse files
authored
fix: Add conditional push for changes in release workflow (#797)
This is to prevent a failure in the release workflow if no temp-build-branch is found, which will happen if you change something that does not result in build output (dist/).
1 parent c33711d commit 1f63b89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,20 @@ jobs:
111111
run: git checkout -b temp-build-branch
112112

113113
- name: Commit and Push Changes (to temp branch)
114+
id: commit_and_push
114115
run: |
115116
git add dist/ package-lock.json index.html
116117
if [ -z "$(git status --porcelain)" ]; then
117118
echo "No changes to commit"
119+
echo "changes_pushed=false" >> "$GITHUB_OUTPUT"
118120
exit 0
119121
fi
120122
git commit -m "Update dist folder [skip ci]"
121123
git push --force origin temp-build-branch
124+
echo "changes_pushed=true" >> "$GITHUB_OUTPUT"
122125
123126
- name: Trigger Create Release Workflow
127+
if: steps.commit_and_push.outputs.changes_pushed == 'true'
124128
uses: benc-uk/workflow-dispatch@v1
125129
with:
126130
workflow: dist-pr.yml

0 commit comments

Comments
 (0)