diff --git a/.github/workflows/ci-debug.yml b/.github/workflows/ci-debug.yml index 1a38923e59f..3a9bb91f22c 100644 --- a/.github/workflows/ci-debug.yml +++ b/.github/workflows/ci-debug.yml @@ -27,14 +27,14 @@ jobs: run: | echo "::set-output name=timestamp::$(/bin/date -u +%Y%m%d-%H%M%S)" + echo "::set-output name=repository::${{ github.repository }}" + if [[ "$GITHUB_EVENT_NAME" = "pull_request_target" ]]; then echo "::set-output name=environment::code-analysis_unsafe" - echo "::set-output name=repository::${{ github.event.pull_request.head.repo.full_name }}" echo "::set-output name=ref::refs/pull/$(cat $GITHUB_EVENT_PATH | jq .number)/merge" else - echo "::set-output name=repository::${{ github.repository }}" - echo "::set-output name=ref::${{ github.ref }}" echo "::set-output name=environment::code-analysis" + echo "::set-output name=ref::${{ github.ref }}" fi if [[ "$GITHUB_EVENT_NAME" = "pull_request" || "$GITHUB_EVENT_NAME" == "pull_request_target" ]]; then echo "::set-output name=sha::${{ github.event.pull_request.head.sha }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 356942786ae..10b3f1a6b05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,14 +28,14 @@ jobs: run: | echo "::set-output name=timestamp::$(/bin/date -u +%Y%m%d-%H%M%S)" + echo "::set-output name=repository::${{ github.repository }}" + if [[ "$GITHUB_EVENT_NAME" = "pull_request_target" ]]; then echo "::set-output name=environment::code-analysis_unsafe" - echo "::set-output name=repository::${{ github.event.pull_request.head.repo.full_name }}" echo "::set-output name=ref::refs/pull/$(cat $GITHUB_EVENT_PATH | jq .number)/merge" else - echo "::set-output name=repository::${{ github.repository }}" - echo "::set-output name=ref::${{ github.ref }}" echo "::set-output name=environment::code-analysis" + echo "::set-output name=ref::${{ github.ref }}" fi if [[ "$GITHUB_EVENT_NAME" = "pull_request" || "$GITHUB_EVENT_NAME" == "pull_request_target" ]]; then echo "::set-output name=sha::${{ github.event.pull_request.head.sha }}"