-
Notifications
You must be signed in to change notification settings - Fork 2
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
/bin/bash: line 1: GITHUB_STATUS_CONTEXT: unbound variable #1
Comments
okay I see now. I compared my cci job with yours, which was successful https://app.circleci.com/pipelines/github/samsalisbury/orb-github-status/8/workflows/4dce4298-03fc-473f-aaa9-06f084f8ed31/jobs/17 this is missing: (among others) set +u # Allow context and description to contain unbound variables. and apparently you are still using 0.0.1 version in your circleci.yml config: So FYI, 0.0.2 does not work (affecting commit: 98c3b3b), and 0.0.1 seems to work. |
Unfortunately, 0.0.1 does not work on macos environment in turn. I haven't checked 0.0.2 on macos. version: 2.1
orbs:
github-status: samsalisbury/[email protected]
jobs:
build-ios:
macos:
xcode: "11.1.0"
steps:
- github-status/pending Result: #!/bin/bash -eo pipefail
set -euo pipefail
set +u # Allow context and description to contain unbound variables.
CONTEXT="$GITHUB_STATUS_CONTEXT"
DESCRIPTION="$GITHUB_STATUS_DESCRIPTION"
set -u
[ -n "$CONTEXT" ] || CONTEXT="circleci/$CIRCLE_JOB"
[ -n "$DESCRIPTION" ] || DESCRIPTION="$CONTEXT"
# Export the latest values for CONTEXT and DESCRIPTION so later calls
# do not need to set them explicitly again.
echo "export GITHUB_STATUS_CONTEXT='$CONTEXT'" >> $BASH_ENV
echo "export GITHUB_STATUS_DESCRIPTION='$DESCRIPTION'" >> $BASH_ENV
# Compose our URL and auth pieces.
API=https://api.github.com
USER=$CIRCLE_PROJECT_USERNAME
REPO=$CIRCLE_PROJECT_REPONAME
SHA=$CIRCLE_SHA1
AUTH=$GITHUB_STATUS_USER:$GITHUB_STATUS_TOKEN
URL=$API/repos/$USER/$REPO/statuses/$SHA
# Compose the body.
# The read below will exit with 1 as it hits EOF,
# so we temporarily disable error checking.
set +e
read -r -d '' BODY <<EOF
{
"state": "pending",
"target_url": "$CIRCLE_BUILD_URL",
"description": "pending: $DESCRIPTION",
"context": "$CONTEXT"
}
EOF
set -euo pipefail
# Post the status (use echo-pipe not <<< for greater shell compat).
echo $BODY | curl -u $AUTH -XPOST -d@- $URL
/bin/bash: line 1: PROMPT_COMMAND: unbound variable I've found this regarding that |
This fixes execution issues mentioned in samsalisbury#1 for both linux and macos runners fixes samsalisbury#1
Hi,
I am trying to use your orb in my circleci config.
But it crashes right away at the "pending" command. What am I missing?
The text was updated successfully, but these errors were encountered: