Skip to content

Commit

Permalink
[affected][bugfix]: baseRef when process.env.BASE_REF set externally
Browse files Browse the repository at this point in the history
  • Loading branch information
leblancmeneses committed Dec 17, 2024
1 parent c4aaa40 commit b027708
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion apps/affected/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { AST } from './parser.types';


export const getImageName = (appTarget: string, hasChanges: boolean, sha: string, productionBranch?: string, imageTagPrefix?: string) => {
const baseRef = process.env.BASE_REF || github.context.payload?.pull_request?.base?.ref || process.env.GITHUB_REF_NAME;
let baseRef = process.env.BASE_REF || github.context.payload?.pull_request?.base?.ref || process.env.GITHUB_REF_NAME;

if (baseRef && baseRef.includes('/')) {
baseRef = baseRef.split('/').pop();
}

let imageName1 = `${appTarget}:${baseRef}-${sha}`;
if (!hasChanges) {
Expand Down
2 changes: 1 addition & 1 deletion dist/apps/affected/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b027708

Please sign in to comment.