diff --git a/download-artifacts/action.yml b/download-artifacts/action.yml index f013abb2..bc4c3ef3 100644 --- a/download-artifacts/action.yml +++ b/download-artifacts/action.yml @@ -93,6 +93,8 @@ outputs: description: JSON array with details about found artifacts artifact-build-commit: description: The commit related to the artifact that was found + artifact-build-branch: + description: The branch related to the artifact that was found runs: using: node20 main: main.js diff --git a/download-artifacts/main.js b/download-artifacts/main.js index 8d27eba0..23bcaa6f 100644 --- a/download-artifacts/main.js +++ b/download-artifacts/main.js @@ -192,7 +192,10 @@ async function main() { core.setOutput("artifacts", artifacts) const artifactBuildCommit = artifacts[0].workflow_run.head_sha; - core.setOutput("artifact-build-commit", artifactBuildCommit) + core.setOutput("artifact-build-commit", artifactBuildCommit); + + const artifactBuildBranch = artifacts[0].workflow_run.head_branch; + core.setOutput("artifact-build-branch", artifactBuildBranch); if (dryRun) { if (artifacts.length == 0) { @@ -219,7 +222,7 @@ async function main() { } core.setOutput("found_artifact", true) - + for (const artifact of artifacts) { core.info(`==> Artifact: ${artifact.id}`) @@ -274,7 +277,7 @@ async function main() { function setExitMessage(ifNoArtifactFound, message) { core.setOutput("found_artifact", false) - + switch (ifNoArtifactFound) { case "fail": core.setFailed(message)