ci: speed up `publish_artifacts` CircleCI job for PRs (#29028)

PR Close #29028
This commit is contained in:
George Kalpakas 2019-02-28 17:23:54 +02:00 committed by Andrew Kushnir
parent 5fdf24e843
commit d207c4894a
1 changed files with 10 additions and 8 deletions

View File

@ -461,18 +461,20 @@ jobs:
publish_snapshot: publish_snapshot:
<<: *job_defaults <<: *job_defaults
steps: steps:
- *attach_workspace
- *init_environment
# See below - ideally this job should not trigger for non-upstream builds. # See below - ideally this job should not trigger for non-upstream builds.
# But since it does, we have to check this condition. # But since it does, we have to check this condition.
- run: - run:
name: Skip this job for Pull Requests and Fork builds name: Skip this job for Pull Requests and Fork builds
# Note, `|| true` on the end makes this step always exit 0 # Note: Using `CIRCLE_*` env variables (instead of those defined in `env.sh` so that this
command: '[[ # step can be run before `init_environment`.
"$CI_PULL_REQUEST" != "false" command: >
|| "$CI_REPO_OWNER" != "angular" if [[ -n "${CIRCLE_PR_NUMBER}" ]] ||
|| "$CI_REPO_NAME" != "angular" [[ "$CIRCLE_PROJECT_USERNAME" != "angular" ]] ||
]] && circleci step halt || true' [[ "$CIRCLE_PROJECT_REPONAME" != "angular" ]]; then
circleci step halt
fi
- *attach_workspace
- *init_environment
# CircleCI has a config setting to force SSH for all github connections # CircleCI has a config setting to force SSH for all github connections
# This is not compatible with our mechanism of using a Personal Access Token # This is not compatible with our mechanism of using a Personal Access Token
# Clear the global setting # Clear the global setting