Skip to content

Commit 9e3bbb1

Browse files
refactored diff
1 parent 2747bad commit 9e3bbb1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/backend.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ jobs:
3232
version: v1.58
3333
working-directory: backend
3434

35-
# this check will exit non-zero when grep fails to find a match
36-
# but that status is used in later if statements hence continue on error
3735
- name: Check for changes in backend/
38-
id: backendDiff
39-
run: git --no-pager diff --name-only origin/main HEAD | grep backend/
40-
continue-on-error: true
41-
36+
id: diff
37+
run: echo "files_changed=$(git --no-pager diff --name-only origin/main HEAD)" >> $GITHUB_OUTPUT
38+
4239
build:
4340
name: Build and Push
44-
if: jobs.lint.steps.backendDiff.outcome == 'success'
41+
needs: lint
42+
if: contains(needs.lint.outputs.files_changed, 'backend/')
4543
environment: DEV
4644
runs-on: ubuntu-latest
4745
permissions:

0 commit comments

Comments
 (0)