Skip to content

Commit

Permalink
[BRE-49] Add Artifact Build Branch (#292)
Browse files Browse the repository at this point in the history
* add artifact build branch

* add output
  • Loading branch information
Eeebru authored Jun 10, 2024
1 parent 60e6af5 commit 2bd1450
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions download-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions download-artifacts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -219,7 +222,7 @@ async function main() {
}

core.setOutput("found_artifact", true)

for (const artifact of artifacts) {
core.info(`==> Artifact: ${artifact.id}`)

Expand Down Expand Up @@ -274,7 +277,7 @@ async function main() {

function setExitMessage(ifNoArtifactFound, message) {
core.setOutput("found_artifact", false)

switch (ifNoArtifactFound) {
case "fail":
core.setFailed(message)
Expand Down

0 comments on commit 2bd1450

Please sign in to comment.