File tree Expand file tree Collapse file tree 1 file changed +21
-20
lines changed
Expand file tree Collapse file tree 1 file changed +21
-20
lines changed Original file line number Diff line number Diff line change @@ -25,30 +25,31 @@ jobs:
2525 run : git fetch --no-tags --prune --depth=1 origin '+refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}'
2626
2727 - id : diff
28- if : github.event_name == 'pull_request'
2928 name : diff against the base branch latest commit for specific paths
3029 run : |
31- git diff \
32- origin/${{ github.base_ref }} \
33- HEAD \
34- -- \
35- 'bin/**' \
36- 'lib/**' \
37- 'script/**' \
38- 'spec/**' \
39- 'vendor/**' \
40- '.ruby-version' \
41- 'entitlements-github-plugin.gemspec' \
42- 'Gemfile' \
43- 'Gemfile.lock' \
44- > diff.txt
30+ if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
31+ git diff \
32+ origin/${{ github.base_ref }} \
33+ HEAD \
34+ -- \
35+ 'bin/**' \
36+ 'lib/**' \
37+ 'script/**' \
38+ 'spec/**' \
39+ 'vendor/**' \
40+ '.ruby-version' \
41+ 'entitlements-github-plugin.gemspec' \
42+ 'Gemfile' \
43+ 'Gemfile.lock' \
44+ > diff.txt
4545
4646 # If the diff file is not empty, it has changes.
47- [ -s diff.txt ] && echo "::set-output name=has_change::true" || echo "::set-output name=has_change::false"
48-
49- - name : set has_change to true for push to main/master
50- if : github.event_name == 'push'
51- run : echo "::set-output name=has_change::true"
47+ if [ -s diff.txt ]; then
48+ echo "::set-output name=has_change::true"
49+ fi
50+ elif [ "$GITHUB_EVENT_NAME" = "push" ]; then
51+ echo "::set-output name=has_change::true"
52+ fi
5253
5354 acceptance-suite :
5455 needs : changes
You can’t perform that action at this time.
0 commit comments