8291444: GHA builds/tests won't run manually if disabled from automatic running

Reviewed-by: serb, erikj, ihse
This commit is contained in:
Christoph Langer 2022-12-02 11:03:53 +00:00
parent 6d0fbb2c49
commit 5c0ff26f32

View File

@ -77,19 +77,17 @@ jobs:
# 'false' otherwise.
# arg $1: platform name or names to look for
function check_platform() {
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
echo 'false'
return
fi
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
input='${{ github.event.inputs.platforms }}'
elif [[ $GITHUB_EVENT_NAME == push ]]; then
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
echo 'false'
return
else
echo 'Internal error in GHA'
exit 1
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
fi
fi
normalized_input="$(echo ,$input, | tr -d ' ')"