Skip to content

Commit

Permalink
Merge pull request #541 from Tradeshift/POPS-3158_disable_tag_with_pr…
Browse files Browse the repository at this point in the history
…efix

fix: disable tag with prefix
  • Loading branch information
arminioa committed Jan 17, 2024
2 parents 82c5efe + 58fedce commit 59a9d42
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ inputs:
based on the type of build: on master or on pull rquest.
An image built from a pull request is tagged with pr-<number>-<SHA>.
An image built on merge to master branch is tagged with master-<SHA>.
default: true
useqemu:
required: false
description: >
Expand Down
6 changes: 4 additions & 2 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ async function getSHATagWithPrefix(repository: string): Promise<string> {

let shaWithPrefix: string;
const ref = event?.ref || '';
if (ref !== '' && ref === `refs/heads/${default_branch}`) {
// on merge to default branch
const schedule = event?.schedule || '';
if (
(ref !== '' && ref === `refs/heads/${default_branch}`) ||
schedule !== ''
) {
// on merge to default branch or on scheduled workflow
shaWithPrefix = `${default_branch}-${sha}`;
} else {
// on pull request
Expand Down

0 comments on commit 59a9d42

Please sign in to comment.