Skip to content

Commit 8781ddf

Browse files
committed
reduce noise if there are no changes
1 parent acd8bd8 commit 8781ddf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/update-desktop.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,31 @@ jobs:
7070
env:
7171
ASSETS_JSON: ${{ toJson(github.event.client_payload.release.assets ) }}
7272
- name: Commit and push
73+
id: commit-and-push
7374
run: |
7475
git config user.name "cryptobot"
7576
git config user.email "cryptobot@users.noreply.github.com"
7677
git config push.autoSetupRemote true
7778
git stage config/_default/params.yaml
79+
if git diff --cached --quiet; then
80+
echo "No changes to commit"
81+
echo "changed=false" >> "$GITHUB_OUTPUT"
82+
exit 0
83+
fi
7884
git commit -m "Update desktop download urls to release ${DESKTOP_VERSION}"
7985
git push
86+
echo "changed=true" >> "$GITHUB_OUTPUT"
8087
- name: Create pull request
8188
id: create-pr
89+
if: steps.commit-and-push.outputs.changed == 'true'
8290
run: |
8391
printf "Created by $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" > pr_body.md
8492
PR_URL=$(gh pr create --title "Desktop release ${DESKTOP_VERSION}" --body-file pr_body.md)
8593
echo "url=$PR_URL" >> "$GITHUB_OUTPUT"
8694
env:
8795
GH_TOKEN: ${{ secrets.CRYPTOBOT_PR_TOKEN }}
8896
- name: Slack Notification
97+
if: steps.commit-and-push.outputs.changed == 'true'
8998
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
9099
env:
91100
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_CRYPTOMATOR_DESKTOP }}

0 commit comments

Comments
 (0)