Last active
September 2, 2024 17:55
-
-
Save somidad/3ce6e8a7b7d77ac8fa7fad583003d6f5 to your computer and use it in GitHub Desktop.
GitHub Workflow to check any change on git repository and do something if any
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
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files | |
- name: Check if there is any change | |
id: get_changes | |
# deprecated. see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ | |
#run: echo "::set-output name=changed::$(git status --porcelain | wc -l)" | |
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT | |
- name: Do something if there is any change | |
if: steps.get_changes.outputs.changed != 0 | |
run: do something |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment