Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search_artifacts: true #235

Open
mattkoch-bb opened this issue Apr 7, 2023 · 1 comment
Open

search_artifacts: true #235

mattkoch-bb opened this issue Apr 7, 2023 · 1 comment

Comments

@mattkoch-bb
Copy link

Hi, thanks for this action. I was looking through the documentation, what exactly does search_artifacts: true do? I am trying to find the "latest" build artifact produced by another workflow.

@dawidd6
Copy link
Owner

dawidd6 commented Aug 11, 2023

if (checkArtifacts || searchArtifacts) {
let artifacts = await client.paginate(client.rest.actions.listWorkflowRunArtifacts, {
owner: owner,
repo: repo,
run_id: run.id,
})
if (!artifacts || artifacts.length == 0) {
continue
}
if (searchArtifacts) {
const artifact = artifacts.find((artifact) => {
if (nameIsRegExp) {
return artifact.name.match(name) !== null
}
return artifact.name == name
})
if (!artifact) {
continue
}
}
}

Searches for latest workflow run that produced an artifact, cause you can have workflow runs that did not produce an artifact and the Action would fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants