From 423c83072f5dc5bf4dc611ea88b710d8ac2ff26b Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Thu, 11 Feb 2021 13:45:04 -0500 Subject: [PATCH] Update Phar deployment to work with GitHub Actions --- bin/travis-deploy-phar.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/travis-deploy-phar.sh b/bin/travis-deploy-phar.sh index ed55ff2fca2..d7881df0e9f 100755 --- a/bin/travis-deploy-phar.sh +++ b/bin/travis-deploy-phar.sh @@ -3,14 +3,14 @@ set -e -if [[ ${TRAVIS_REPO_SLUG} != 'vimeo/psalm' && -z ${PHAR_REPO_SLUG} ]]; then +if [[ ${GITHUB_REPOSITORY} != 'vimeo/psalm' && -z ${PHAR_REPO_SLUG} ]]; then echo 'Not attempting phar deployment, as this is not vimeo/psalm, and $PHAR_REPO_SLUG is unset or empty' exit 0; fi; PHAR_REPO_SLUG=${PHAR_REPO_SLUG:=psalm/phar} -git clone https://${GITHUB_TOKEN}@github.com/${PHAR_REPO_SLUG}.git phar > /dev/null 2>&1 +git clone https://${PHAR_REPO_TOKEN}@github.com/${PHAR_REPO_SLUG}.git phar > /dev/null 2>&1 set -x # don't do set x above this point to protect the GITHUB_TOKEN @@ -19,13 +19,13 @@ rm -rf * cp ../build/psalm.phar ../assets/psalm-phar/* . cp ../build/psalm.phar.asc || true # not all users have GPG keys mv dot-gitignore .gitignore -git config user.email "travis@travis-ci.org" -git config user.name "Travis CI" +git config user.email "github@muglug.com" +git config user.name "Automated commit" git add --all . -git commit -m "Updated Psalm phar to commit ${TRAVIS_COMMIT}" +git commit -m "Updated Psalm phar to commit ${GITHUB_SHA}" git push --quiet origin master > /dev/null 2>&1 -if [[ "$TRAVIS_TAG" != '' ]] ; then - git tag "$TRAVIS_TAG" - git push origin "$TRAVIS_TAG" +if [[ "$GITHUB_REF" != '' ]] ; then + git tag "$GITHUB_REF" + git push origin "$GITHUB_REF" fi