Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test commit #910

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/build_test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
TERMINUS_SITE: ${{ secrets.TERMINUS_SITE }}
TERMINUS_SITE2: ${{ secrets.TERMINUS_SITE2 }}
BASH_ENV: "./bash_env.txt"
CI_BRANCH: ${{ github.ref }}
GITHUB_REF: ${{ github.ref }}
COMMIT_SHA: ${{ github.sha }}
CI_BUILD_NUMBER: ${{ github.run_number }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
Expand Down Expand Up @@ -49,22 +49,22 @@ jobs:
# https://github.com/pantheon-systems/docker-build-tools-ci/blob/6.x/scripts/set-environment
- name: setup-environment-vars
run: |
echo '1' $CI_BRANCH
if [[ "$CI_BRANCH" =~ ^refs/pull/([0-9]+)/merge$ ]]; then
echo '1' $GITHUB_REF
if [[ "$GITHUB_REF" =~ ^refs/pull/([0-9]+)/merge$ ]]; then
export PR_NUMBER=${BASH_REMATCH[1]}
echo '2' $PR_NUMBER

export CI_BRANCH=`curl -u "${GITHUB_OWNER}:${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.groot-preview+json" \
"https://api.github.com/repos/${CI_PROJECT_NAME}/pulls/${pr_number}" | \
python3 -c "import sys, json; print(json.load(sys.stdin)[0]['head']['ref'])"`
"https://api.github.com/repos/${CI_PROJECT_NAME}/pulls/${PR_NUMBER}" | \
python3 -c "import sys, json; print(json.load(sys.stdin)['head']['ref'])"`

export CI_PULL_REQUEST=`curl -u "${GITHUB_OWNER}:${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.groot-preview+json" \
"https://api.github.com/repos/${CI_PROJECT_NAME}/pulls/${pr_number}" | \
python3 -c "import sys, json; print(json.load(sys.stdin)[0]['html_url'])"`
"https://api.github.com/repos/${CI_PROJECT_NAME}/pulls/${PR_NUMBER}" | \
python3 -c "import sys, json; print(json.load(sys.stdin)['html_url'])"`

elif [ "$CI_BRANCH" != "refs/heads/main" ]; then
elif [ "$GITHUB_REF" != "refs/heads/main" ]; then
echo '3'
export PR_NUMBER=`curl -u "${GITHUB_OWNER}:${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.groot-preview+json" \
Expand Down