Skip to content

Commit

Permalink
image tag detection for push or pull_request
Browse files Browse the repository at this point in the history
  • Loading branch information
hspitzley-czi committed Aug 22, 2024
1 parent 2bfb27c commit addd8bb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/actions/argus-builder/build-prep/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,19 @@ runs:
uses: actions/github-script@v7
with:
script: |
console.log('context.sha:', context.sha);
console.log('context.payload.pull_request.head.sha:', context.payload.pull_request.head.sha);
let sha;
if (context.eventName === "pull_request") {
console.log('pull_request:', context.payload.pull_request.head.sha);
sha = context.payload.pull_request.head.sha;
} else if (context.eventName === "push") {
console.log('push:', context.sha);
sha = context.sha;
} else {
core.setFailed(`EventName ${eventName} not supported`);
return;
}
console.log('IMAGE_TAG:', `sha-${sha.slice(0, 7)}`);
core.setOutput('IMAGE_TAG', `sha-${sha.slice(0, 7)}`);
- name: Validate build tag
uses: actions/github-script@v7
Expand Down

0 comments on commit addd8bb

Please sign in to comment.