@@ -61,21 +61,21 @@ jobs:
6161 env :
6262 GH_TOKEN : ${{ github.token }}
6363 run : |
64- echo "::group:: Debug information"
65- echo " Workflow: ${{ github.workflow }}"
66- echo "Action : ${{ github.event.action }}"
67- if [[ " ${{ github.event_name }}" == "pull_request" ]]
68- echo "PR: ${{ github.event.number }}"
69- echo "Event Triggered by : ${{ github.event.sender.login }}"
70- elif [[ " ${{ github.event_name }}" == "workflow_dispatch" ]]
71- echo "Inputs"
72- cat <<EOF
73- ${{ toJSON(inputs) }}
74- EOF
75- fi
76- echo "::endgroup::"
77- h1= "Accept: application/vnd.github+json"
78- h2= "X-GitHub-Api-Version: 2022-11-28"
64+ # Debug information
65+ # Workflow: ${{ github.workflow }}
66+ # Event Name : ${{ github.event_name }}
67+ # Action: ${{ github.event.action }}
68+ # pull_request-Event
69+ # PR : ${{ github.event.number }}
70+ # Event Triggered by: ${{ github.event.sender.login }}
71+ # workflow_dispatch-Event
72+ # Inputs:
73+ cat > /dev/null <<ENDOFINPUTS
74+ ${{ toJSON(inputs) }}
75+ ENDOFINPUTS
76+
77+ gh_header=(-H "Accept: application/vnd.github+json"
78+ (-H "X-GitHub-Api-Version: 2022-11-28")
7979 if [[ "${{ github.event_name }}" == "pull_request" ]]
8080 then
8181 if [[ "${{ github.event.action }}" != "labeled" ]] && [[ "${{ github.event.action }}" != "unlabeled" ]]
9494 echo "DOCKER_IMAGE=build-cached" >> $GITHUB_OUTPUT
9595 elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]
9696 then
97- # the inputs context is only useful/set in the workflow dispatch event case
98- if [[ "${{ toJSON(inputs) }}" == "{}" ]] || [[ "${{ inputs.docker-image }}" == "" ]] ; then
97+ # the inputs context is only useful/set in the workflow dispatch event case
98+ if [[ "${{ inputs.docker-image }}" == "" ]] ; then
9999 echo "DOCKER_IMAGE=build-cached" > $GITHUB_OUTPUT
100100 else
101101 echo "DOCKER_IMAGE=${{ inputs.docker-image }}" > $GITHUB_OUTPUT
@@ -105,7 +105,7 @@ jobs:
105105 echo "This workflow is not defined for the event ${{ github.event_name }}!"
106106 exit 1
107107 fi
108- if ! gh api -H "$h1" -H "$h2 " /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
108+ if ! gh api "${gh_header[@]} " /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
109109 then
110110 echo "Only collaborators explicitly listed as collaborators can trigger this workflow!"
111111 echo "CONTINUE=false" >> $GITHUB_OUTPUT
0 commit comments