Skip to content

Commit

Permalink
Revert-removal-ssh (#3904)
Browse files Browse the repository at this point in the history
* add ssh back to pipeline

* add empty changeset
  • Loading branch information
gyfchong authored Jul 24, 2023
1 parent c695bcf commit d61722c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .buildkite/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@ set -e
# shellcheck source=setup-registry.sh
. ".buildkite/scripts/helpers/setup-registry.sh"

GITHUB_SSH_HOST_KEY="github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk="

setup_github() {
git config --global credential.helper cache
git config --global user.email "cultureamp-ci@cultureamp.com"
git config --global user.name "cultureamp-ci"
git config --global user.password "$GH_TOKEN"
git config --global commit.gpgsign false
git config --global --add safe.directory /workspace

eval "$(ssh-agent -s)"
echo "$GH_SSH_KEY" | ssh-add -

echo "Adding GitHub host key to known hosts..."
echo "$GITHUB_SSH_HOST_KEY" | tr -d "\\n" >>/etc/ssh/ssh_known_hosts

echo "Checking GitHub authentication..."
ssh -T git@github.com || true # exits non-zero
}

setup_npm() {
Expand Down Expand Up @@ -45,9 +56,10 @@ release_canary() {
}

main() {
export GH_TOKEN NPM_TOKEN
export GH_SSH_KEY GH_TOKEN NPM_TOKEN

printf "Fetching secrets... "
GH_SSH_KEY=$(get_secret "github-ssh-key") || exit $?
GH_TOKEN=$(get_secret "github-api-token") || exit $?
NPM_TOKEN=$(get_secret "npm-token") || exit $?
echo "(done)"
Expand Down Expand Up @@ -78,7 +90,7 @@ main() {

echo "All done!"

unset GH_TOKEN NPM_TOKEN
unset GH_SSH_KEY GH_TOKEN NPM_TOKEN
}

main
Expand Down
2 changes: 2 additions & 0 deletions .changeset/afraid-panthers-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---

0 comments on commit d61722c

Please sign in to comment.