Skip to content

Commit 66e348f

Browse files
author
Jack Yuan
committed
change pr method (test)
1 parent cc97a0b commit 66e348f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

github-action-build.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,21 @@ EOL
8383
ciRepo=${ciURL##*/}
8484
ciPrefix=${ciURL%/*}
8585
ciOrg=${ciPrefix##*/}
86-
curl -o pull-request.txt https://api.github.com/repos/$ciOrg/$ciRepo/pulls
87-
if [ ${secure_env} != true ]; then
86+
curl -o pull-request.txt https://api.github.com/repos/$ciOrg/$ciRepo/pulls # Check for pull requests
87+
curl -o secure-env.txt https://api.github.com/orgs/scijava/actions/secrets # Check for secure env var
88+
if [ grep -q "documentation_url" secure-env.txt >/dev/null 2>&1 ]; then
8889
echo "No deploy -- secure environment variables not available"
89-
elif [ grep -o "url" pull-request.txt >/dev/null 2>&1 ]; then
90+
elif [ grep -q "url" pull-request.txt >/dev/null 2>&1 ]; then
9091
echo "No deploy -- pull request detected"
9192
elif [ ${repo_fork} != "$ciOrg/$ciRepo" ]; then
9293
echo "No deploy -- repository fork: ${repo_fork} != $ciOrg/$ciRepo"
9394
else
9495
echo "All checks passed for artifact deployment"
9596
deployOK=1
9697
fi
97-
rm pull-request.txt # delete created txt file
98+
# Delete created txt file
99+
rm pull-request.txt
100+
rm secure-env.txt
98101
fi
99102

100103
# Install GPG on OSX/macOS

0 commit comments

Comments
 (0)