Skip to content

Commit 2bd1450

Browse files
authored
[BRE-49] Add Artifact Build Branch (#292)
* add artifact build branch * add output
1 parent 60e6af5 commit 2bd1450

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

download-artifacts/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ outputs:
9393
description: JSON array with details about found artifacts
9494
artifact-build-commit:
9595
description: The commit related to the artifact that was found
96+
artifact-build-branch:
97+
description: The branch related to the artifact that was found
9698
runs:
9799
using: node20
98100
main: main.js

download-artifacts/main.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ async function main() {
192192
core.setOutput("artifacts", artifacts)
193193

194194
const artifactBuildCommit = artifacts[0].workflow_run.head_sha;
195-
core.setOutput("artifact-build-commit", artifactBuildCommit)
195+
core.setOutput("artifact-build-commit", artifactBuildCommit);
196+
197+
const artifactBuildBranch = artifacts[0].workflow_run.head_branch;
198+
core.setOutput("artifact-build-branch", artifactBuildBranch);
196199

197200
if (dryRun) {
198201
if (artifacts.length == 0) {
@@ -219,7 +222,7 @@ async function main() {
219222
}
220223

221224
core.setOutput("found_artifact", true)
222-
225+
223226
for (const artifact of artifacts) {
224227
core.info(`==> Artifact: ${artifact.id}`)
225228

@@ -274,7 +277,7 @@ async function main() {
274277

275278
function setExitMessage(ifNoArtifactFound, message) {
276279
core.setOutput("found_artifact", false)
277-
280+
278281
switch (ifNoArtifactFound) {
279282
case "fail":
280283
core.setFailed(message)

0 commit comments

Comments
 (0)