Skip to content

build: remove unnecessary env.sh logic for circleci #23054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,12 @@ commands:
description: Checkout and rebase the repository
steps:
- checkout
- run:
name: Set up environment
environment:
CIRCLE_GIT_BASE_REVISION: << pipeline.git.base_revision >>
CIRCLE_GIT_REVISION: << pipeline.git.revision >>
command: ./.circleci/env.sh
# After checkout, rebase on top of target branch.
- run:
name: Rebase PR on target branch
# After checkout, rebase on top of target branch.
environment:
CIRCLE_GIT_BASE_REVISION: << pipeline.git.base_revision >>
CIRCLE_GIT_REVISION: << pipeline.git.revision >>
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
# User is required for rebase.
Expand Down
73 changes: 0 additions & 73 deletions .circleci/env-helpers.inc.sh

This file was deleted.

52 changes: 0 additions & 52 deletions .circleci/env.sh

This file was deleted.

14 changes: 12 additions & 2 deletions .circleci/rebase-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,18 @@ function getRefAndShas(sha, owner, name) {

/** Gets the refs and shas for the base and target of the current environment. */
function getRefsAndShasForChange() {
const base = getRefAndShas(process.env['CI_GIT_BASE_REVISION'], process.env['CI_REPO_OWNER'], process.env['CI_REPO_NAME']);
const target = getRefAndShas(process.env['CI_GIT_REVISION'], process.env['CI_PR_USERNAME'], process.env['CI_PR_REPONAME']);
const base = getRefAndShas(
process.env['CIRCLE_GIT_BASE_REVISION'],
process.env['CIRCLE_PROJECT_USERNAME'],
process.env['CIRCLE_PROJECT_REPONAME']
);

const target = getRefAndShas(
process.env['CIRCLE_GIT_REVISION'],
process.env['CIRCLE_PR_USERNAME'],
process.env['CIRCLE_PR_REPONAME']
);

const commonAncestorSha = getCommonAncestorSha(base.sha, target.sha);
return {
base,
Expand Down