Rework the PULL_REQUEST_ID logic, again (#11871)
and move github.event.issue.number to the workflow file....
This commit is contained in:
parent
f88608ccf6
commit
24eb8b3354
2 changed files with 5 additions and 4 deletions
1
.github/workflows/buildkite.yml
vendored
1
.github/workflows/buildkite.yml
vendored
|
|
@ -25,3 +25,4 @@ jobs:
|
|||
BUILDKITE_API_ACCESS_TOKEN: ${{ secrets.buildkite_api_access_token }}
|
||||
PIPELINE: "forem/build-containers"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PULL_REQUEST_ID: ${{ github.event.issue.number }}
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ if [[ -z "$GITHUB_TOKEN" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Get the pull request ID
|
||||
PULL_REQUEST_ID=${{ github.event.issue.number }}
|
||||
|
||||
# Check if PULL_REQUEST_ID is empty or null and try to set it
|
||||
if [[ -z "${PULL_REQUEST_ID}" || "${PULL_REQUEST_ID}" == "null" ]]; then
|
||||
PULL_REQUEST_ID=${{ github.event.number }}
|
||||
PULL_REQUEST_ID=$(jq -r .event.issue.number "${GITHUB_EVENT_PATH}")
|
||||
elif [[ -z "${PULL_REQUEST_ID}" || "${PULL_REQUEST_ID}" == "null" ]]; then
|
||||
PULL_REQUEST_ID=$(jq -r .event.number "${GITHUB_EVENT_PATH}")
|
||||
elif [[ -z "${PULL_REQUEST_ID}" || "${PULL_REQUEST_ID}" == "null" ]]; then
|
||||
echo "Failed to determine PR Number."
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue