Skip to content

Commit dee4c22

Browse files
authored
Merge pull request #11 from chrisgavin/actions-push-acceptance
Fix acceptance tests not running on pushes.
2 parents 84051fa + 5daeb37 commit dee4c22

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

.github/workflows/acceptance.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)