Skip to content

Commit fbdc657

Browse files
committed
test: try to only run job on code change
1 parent 31a5baf commit fbdc657

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/pull_request.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,16 @@ jobs:
5656
- name: Checkout repository
5757
uses: actions/checkout@v2
5858
with:
59-
fetch-depth: 2
60-
- name: Get changed files
61-
id: changes
59+
fetch-depth: 0
60+
- name: Check Diff
61+
uses: technote-space/get-diff-action@v6
62+
with:
63+
PATTERNS: |
64+
+**/*.go
65+
!**/*_test.go
66+
FILES: |
67+
go.mod
68+
- name: Output Diff
69+
if: env.GIT_DIFF
6270
run: |
63-
echo "::set-output name=changes::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'go.mod\|.go$' | grep -v _test.go$ | xargs)"
64-
echo ${{ steps.changes.outputs.changes}}
65-
71+
echo ${{ env.GIT_DIFF }}

0 commit comments

Comments
 (0)