File tree Expand file tree Collapse file tree 5 files changed +20
-4
lines changed
Expand file tree Collapse file tree 5 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 11.DS_Store
22orb.yml
3+
4+ .idea
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ repository and set the following environment variables:
3737* ` GITHUB_USERNAME ` - Username of the service user that has read/write permissions to the repo.
3838* ` GITHUB_PASSWORD ` - Password of the service user.
3939* ` GITHUB_EMAIL ` - Email of the service user.
40+ * ` GITHUB_TOKEN ` - API token for the GitHub user
4041
4142### Enabling Slack Notifications
4243
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Publishes and releases the version of the Orb to the CCI repo. Reads in Semantic version for the arg.
3+ # You must have a valid CCI token setup to run this script.
4+
5+ if [ $# -eq 0 ]
6+ then
7+ echo " The semantic version must be provided as an argument. I.E. '1.0.0'"
8+ else
9+ circleci config pack src > orb.yml
10+ circleci orb validate orb.yml
11+ circleci orb publish orb.yml " narrativescience/ghpr@$1 "
12+ fi
13+
Original file line number Diff line number Diff line change 4141
4242 API_GITHUB="https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
4343 PR_REQUEST_URL="$API_GITHUB/pulls/$PR_NUMBER"
44- PR_RESPONSE=$(curl --user "${GITHUB_USERNAME}:${GITHUB_PASSWORD} " "$PR_REQUEST_URL")
44+ PR_RESPONSE=$(curl -H "Authorization: token $GITHUB_TOKEN " "$PR_REQUEST_URL")
4545
4646 PR_TITLE=$(echo $PR_RESPONSE | jq -e '.title' | tr -d '"')
4747 echo "PR_TITLE: $PR_TITLE"
6363
6464 PR_MERGE_COMMIT_SHA=$(echo $PR_RESPONSE | jq -e '.merge_commit_sha' | tr -d '"')
6565 COMMIT_REQUEST_URL="$API_GITHUB/commits/$PR_MERGE_COMMIT_SHA"
66- COMMIT_RESPONSE=$(curl --user "${GITHUB_USERNAME}:${GITHUB_PASSWORD} " "$COMMIT_REQUEST_URL")
66+ COMMIT_RESPONSE=$(curl -H "Authorization: token $GITHUB_TOKEN " "$COMMIT_REQUEST_URL")
6767 fi
6868
6969 <<# parameters.get_pr_author_email >>
8080
8181 <<# parameters.get_commit_message >>
8282 COMMIT_REQUEST_URL="$API_GITHUB/commits/$CIRCLE_SHA1"
83- COMMIT_RESPONSE=$(curl --user "${GITHUB_USERNAME}:${GITHUB_PASSWORD} " "$COMMIT_REQUEST_URL")
83+ COMMIT_RESPONSE=$(curl -H "Authorization: token $GITHUB_TOKEN " "$COMMIT_REQUEST_URL")
8484 PR_COMMIT_MESSAGE=$(echo $COMMIT_RESPONSE | jq -e '.commit.message' | tr -d '"')
8585 echo "PR_COMMIT_MESSAGE: $PR_COMMIT_MESSAGE"
8686 echo "export GITHUB_PR_COMMIT_MESSAGE='$PR_COMMIT_MESSAGE'" >> $BASH_ENV
Original file line number Diff line number Diff line change 2222 curl \
2323 -X POST \
2424 -d "{\"body\": \"<< parameters.comment >>\"}" \
25- --user "${GITHUB_USERNAME}:${GITHUB_PASSWORD} " \
25+ -H "Authorization: token $GITHUB_TOKEN " \
2626 "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/issues/${GITHUB_PR_NUMBER}/comments"
You can’t perform that action at this time.
0 commit comments