-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflow that fails if process compose is edited but docker compose i…
…sn't
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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,28 @@ | ||
# Fails if process-compose is edited but not docker-compose | ||
name: Check Demo Consistency | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'process-compose.yaml' | ||
- 'docker-compose.yml' | ||
|
||
jobs: | ||
check-edits: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check for file edits | ||
run: | | ||
FILES_CHANGED=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }}) | ||
# Check if process-compose.yaml is edited | ||
if echo "$FILES_CHANGED" | grep -q "process-compose.yaml"; then | ||
# Fail if docker-compose.yml is not also edited | ||
if ! echo "$FILES_CHANGED" | grep -q "docker-compose.yml"; then | ||
echo "process-compose.yaml is edited but not docker-compose.yml" | ||
exit 1 | ||
fi | ||
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