diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a0460400..b51bd9e75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: env: ACCESS_TOKEN: ${{ secrets.CI_TOKEN }} MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message }} + BRANCH: ${{ github.ref_name }} - name: Build site run: yarn run site:build - name: 'Deploy Site' diff --git a/scripts/ci/build-artifacts.sh b/scripts/ci/build-artifacts.sh index 1fd8e5886..fa0efa390 100755 --- a/scripts/ci/build-artifacts.sh +++ b/scripts/ci/build-artifacts.sh @@ -2,6 +2,12 @@ set -e +if [ -z ${ACCESS_TOKEN} ]; then + echo "Error: No access token for GitHub could be found." \ + "Please set the environment variable 'ACCESS_TOKEN'." + exit 0 +fi + readonly thisDir=$(cd $(dirname $0); pwd) commitSha=$(git rev-parse --short HEAD) @@ -17,19 +23,6 @@ cd $(dirname $0)/../.. DIST="$(pwd)/dist" -# if [[ ${commitAuthorName} != '卡色' && ${commitAuthorName} != 'cipchk' ]]; then -# echo "Warning: Just only 卡色 or cipchk user" -# exit 0 -# fi - -# echo "ACCESS_TOKEN: ${ACCESS_TOKEN}.." - -if [ -z ${ACCESS_TOKEN} ]; then - echo "Error: No access token for GitHub could be found." \ - "Please set the environment variable 'ACCESS_TOKEN'." - exit 0 -fi - buildDir=${DIST}/publish rm -rf ${buildDir} mkdir -p ${buildDir} @@ -38,7 +31,7 @@ cp -r ${DIST}/ng-alain ${buildDir}/ng-alain packageRepo=delon-builds buildVersion=$(node -pe "require('./package.json').version") -branchName=${TRAVIS_BRANCH:-'master'} +branchName=${BRANCH:-'master'} buildVersionName="${buildVersion}-${commitSha}" buildTagName="${branchName}-${commitSha}"