-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip(github): add composite action to test directory changes and pass/…
…exit early
- Loading branch information
Showing
2 changed files
with
27 additions
and
8 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,22 @@ | ||
name: "Pass Workflow and Exit if Directory Unchanged" | ||
description: "If the provided directory has no changes, exit and pass the workflow." | ||
author: dgrebb | ||
|
||
inputs: | ||
WORKSPACE_ROOT: | ||
description: "Working Directory" | ||
TEST_DIRECTORY: | ||
description: "The directory to test." | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Pass if FE has no Changes" | ||
shell: bash | ||
run: | | ||
if git diff --quiet --exit-code ${{ inputs.TEST_DIRECTORY }}; then | ||
echo "No changes found in ${{ inputs.TEST_DIRECTORY }} — exiting workflow." | ||
exit 0 | ||
else | ||
echo "Changes detected in the directory." | ||
fi |
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