GithubHelp home page GithubHelp logo

dawidd6 / action-download-artifact Goto Github PK

View Code? Open in Web Editor NEW
660.0 8.0 194.0 13.44 MB

:gear: A GitHub Action to download an artifact associated with given workflow and commit or other criteria

License: MIT License

JavaScript 100.00%
github-actions github action actions download artifact workflow commit

action-download-artifact's Introduction

Hello there

GH stats

action-download-artifact's People

Contributors

alexesprit avatar amezin avatar antongolub avatar bambooch avatar dawidd6 avatar dependabot-preview[bot] avatar dependabot[bot] avatar enricomi avatar fagerli93 avatar garyhughes avatar itrooz avatar jeremyd2019 avatar klutchell avatar kopackiw avatar koplo199 avatar laurentsenta avatar leshikus avatar lukasz-mitka avatar m1kep avatar martcus avatar mortenlj avatar nickthegroot avatar omristeiner avatar ping avatar robbie-unlikelyai avatar romangg avatar shitlsh avatar stavares843 avatar thomedw avatar wdconinc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-download-artifact's Issues

Unexpected input(s) 'check_artifacts'

When adding the check_inputs to the workflow, GitHub Actions reports a warning

Warning: Unexpected input(s) 'check_artifacts', valid inputs are ['github_token', 'workflow', 'workflow_conclusion', 'repo', 'pr', 'commit', 'branch', 'event', 'run_id', 'run_number', 'name', 'path']

It looks like maybe just a new release needs to be made, as the last one was August 4 and this feature was added in August 11?

Here's a snippet of the workflow

    steps:
      - uses: actions/checkout@v2
      - name: Download Server Coverage
        uses: dawidd6/action-download-artifact@v2
        continue-on-error: true
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          workflow: monorepo.yml
          workflow_conclusion: success
          branch: master
          check_artifacts: true
          name: server-coverage
          path: coverage/server

      - name: Download Web App Coverage
        uses: dawidd6/action-download-artifact@v2
        continue-on-error: true
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          workflow: monorepo.yml
          workflow_conclusion: success
          branch: master
          check_artifacts: true
          name: web-app-coverage
          path: coverage/web-app

GitHub token is not optional

The README here says:

    # Optional, GitHub token, a Personal Access Token with `public_repo` scope if needed
    github_token: ${{secrets.GITHUB_TOKEN}}, required if artifact is from a different repo

When I tried using this without the github_token I got:

Run dawidd6/action-download-artifact@v2
==> Workflow: test
==> Repo: oscarbenjamin/sympy
==> Conclusion: success
Error: Not Found

Adding in the GITHUB_TOKEN made it work so I guess that this is always required.

Missing something basic?

Trying to use this action to demo passing artifacts between workflows, and not having much luck. "Stage1" workflow generates artifact and triggers "Stage2" workflow:

name: Stage1

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - name: Checkout repository
        uses: actions/[email protected]

      # Runs a set of commands using the runners shell
      - name: Generate a synthetic artifact
        run: |
          ./stage1.sh 10000

      # Save the build artifact(s)
      - name: Save artifact for downstream pipeline
        uses: actions/upload-artifact@v2
        with:
          name: stage1-artifacts
          path: "**/*.art"
          if-no-files-found: error

      # Trigger the next stage of the pipeline
      - name: Trigger the stage2 workflow
        uses: peter-evans/repository-dispatch@v1
        with:
          token: ${{ secrets.DEMO_ACCESS_TOKEN }}
          repository: myorg/stage2
          event-type: stage1-build
          client-payload: '{"repo": "${{ github.repository }}", "workflow": "${{ github.workflow }}", "run_id": "${{ github.run_id }}", "ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

"Stage2" workflow attempts to get the artifact, but always fails:

name: Stage2

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
  
  repository_dispatch:
    types: [stage1-build]
    
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - name: Checkout repository
        uses: actions/[email protected]

      # Say the event client data
      - name: Show client payload context
        env:
          CLIENT_PAYLOAD_CONTEXT: ${{ toJSON(github.event.client_payload) }}
        run: echo "$CLIENT_PAYLOAD_CONTEXT"

      # Get the artifacts from upstream
      - name: Get upstream pipeline artifacts
        uses: dawidd6/action-download-artifact@v2
        with:
          run_id: "${{ github.event.client_payload.run_id }}"
          workflow: "${{ github.event.client_payload.workflow }}"
          repo: "${{ github.event.client_payload.repo }}"

Results from the triggered "Stage2" workflow always look like this, after many different permutations of args to the action-download-artifact action:

Run echo "$CLIENT_PAYLOAD_CONTEXT"
{
  "ref": "refs/heads/main",
  "repo": "myorg/stage1",
  "run_id": "965258430",
  "sha": "7b6f14dc363158c7370c9549130a776f48b4fefe",
  "workflow": "Stage1"
}

Run dawidd6/action-download-artifact@v2
==> Workflow: Stage1
==> Repo: myorg/stage1
==> Conclusion: completed,success
==> RunID: 965258430
Error: Not Found

Am I missing something really basic here?

Allow fetching assets from a branch by event (e.g., commit/push vs. pull-request, ...)

In our workflow we use this action to download artifacts for an integration test for a specific branch.

      - name: Download artifact from specified branch
        uses: dawidd6/action-download-artifact@v2
        with:
          github_token: ${{secrets.GITHUB_TOKEN}}
          workflow: CI.yml
          workflow_conclusion: success
          branch: ${{ steps.determine_branch.outputs.BRANCH}}
          path: ./dist

image

Unfortunately, we often end up getting artifacts from a Pull Request onto that branch, instead of the specified branch.
image

The cause of this is GitHubs API.

However, the fix should be simple. It should be possible to also add an event filter here (e.g., event=push).

const endpoint = "GET /repos/:owner/:repo/actions/workflows/:id/runs?status=:status&branch=:branch"
const params = {
owner: owner,
repo: repo,
id: workflow,
branch: branch,
status: workflowConclusion,
}

See GitHub API Docs for /runs.

This would also need to be defined as an input in https://github.com/dawidd6/action-download-artifact/blob/master/action.yml

For comparison:
https://github.com/keptn/keptn/actions/workflows/CI.yml?query=branch%3Arelease-0.8.2+is%3Asuccess
vs.
https://github.com/keptn/keptn/actions/workflows/CI.yml?query=branch%3Arelease-0.8.2+is%3Asuccess+event%3Apush

"Uri expired" failed workflow

My workflow run failed with the message:

Run dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74
  with:
    workflow: main.yml
    name: exec_timetable
    path: ./.
    github_token: ***
    workflow_conclusion: completed,success
    repo: IvanVnucec/rain_alert
==> Workflow: main.yml
==> Repo: IvanVnucec/rain_alert
==> Conclusion: completed,success
==> RunID: 939756615
==> Artifact: 67837064
==> Downloading: exec_timetable.zip (56 B)
Error: {"count":11,"value":"Uri expired"}

Here is the link of the run https://github.com/IvanVnucec/rain_alert/actions/runs/939884480. I hope you can see it.

I've also checked the previous workflow and there were uploaded artifacts that I could download.

Error: no artifacts found, but not on rerun

I have a workflow, which is triggered every night when a build server is finished and uploads several artifacts to github.

My workflow tries to download one of these artifacts using the following job

jobs:
  download-image:
    runs-on: [self-hosted, magnus]
    steps:
      - name: Download workflow artifact ${{ github.event.inputs.image_name }}
        uses: dawidd6/[email protected]
        with:
          workflow: ${{ env.SOURCE_WORKFLOW }}
          run_id: ${{ github.event.inputs.run_id }}
          name: ${{ github.event.inputs.image_name }}

The issue is that I get the Error: no artifacts found error during the night, but when I rerun the job / workflow later, it is successful. I've checked the timestamps on the uploading of the artifacts and confirmed that they are uploaded at least 1 hour before the download-image job has started. Any idea on how to fix this?

Include warning if artifacts not found

Hey dawidd6,

would it be possible to change the artifact not found to a warning and create a boolean variable as output.
In that case we can continue with other steps in the workflow e.g. building the artifacts again from the actual sources.

Cheers

[Feature] Download from other repos

I wanted to ask if you think that it would in theory possible to extend this action to download
from workflows of other repos. In my case from the same organization. Or does that require another token/ some kind of authorization?

error when using branch

Hey @dawidd6,

I am running into an error when using the following combination.

name: Layer via Artifacts if: ${{ steps.git_diff.outputs.diff != true }} uses: dawidd6/action-download-artifact@v2 with: workflow: review.yml branch: development

The error is the following:
Run dawidd6/action-download-artifact@v2 ==> Repo: tb102122/BMWJPSI-BI ==> Branch: development ##[error]Cannot read property 'id' of undefined

Not sure what I do wrong during the setup.
I basically would like to get the artifacts from the last successful PR or from the last merge into the named branch.
How can I achieve this the best?

Thanks for your help!
Cheers Tobias

Action suddenly stopped working

image

This was working fine before today, but today unfortunately I am getting this error that Run ID not found.
For my other repository it takes the artifacts of previous runs, but doesn't identify new runs of the workflow

ECONNREFUSED

Hi all,
I'm having an issue with downloading artifacts that seems to be machine dependent.
It works fine on one machine but not on the other.
Both of them are Raspberry Pi's that are configured as self-hosted runners in github.

This is the log from GH Actions:

Run dawidd6/action-download-artifact@v2
==> Workflow: build-workflow.yml
==> Repo: abelikt/thin-edge.io
==> Conclusion: success
==> Branch: continuous_integration
Error: request to https://api.github.com/repos/abelikt/thin-edge.io/actions/workflows/build-workflow.yml/runs?branch=continuous_integration&event=&status=success failed, reason: connect ECONNREFUSED 140.82.121.6:443

It seems to work fine when I do this on the machine where it fails:
curl "https://api.github.com/repos/abelikt/thin-edge.io/actions/workflows/build-workflow.yml/runs?branch=continuous_integration&event=&status=success"

I'm quite puzzled.
Do you maybe have an Idea why this could happen?

Thanks & regards
Michael

How to debug "Not Found" error

I have configured this workflow like so;

      - name: Download the-web server
        uses: dawidd6/action-download-artifact@v2
        with:
          repo: stqry/the-web
          workflow: the-web.yaml
          branch: develop
          github_token: ${{secrets.GITHUB_TOKEN}}

And I get a simple error "Error: Not Found" in GHA:

image

  1. How do I debug this further?
  2. What is required to access an artifact in a private repo within the same organization?
  3. Should the github_token setting be for the other repo?

Getting latest artifacts when I want latest artifact based on branch name and event

In my scenario I am trying to pull in artifacts from other projects (repo). For example, we have a libraries repository and must pull in the correct artifacts as dependencies to a child project (repo), install them and build the application. Some projects will pull artifacts from three different projects. We attempting to handle this by making pull requests with the same user branch name and if the dependent project branch does not exist, we are attempting to use pull requests target branch. In the pull_request.yml file I have:

  - name: Download Library artifacts
    uses: dawidd6/action-download-artifact@v2
    with:
      github_token: ${{secrets.TOKEN}}
      # Required, workflow file name or ID
      workflow: pull_request.yml
      #workflow_conclusion: "completed,success"
      branch: sjk-LDV-648
      # Optional, will use specified workflow run
      #run_id: 1122334455
      #run_number: 34
      event: pull_request
      name: version-num-txt
      path: builder
      repo: SKuhlmanns/steves-test-repo

In SKuhlmanns/steves-test-repo
image

I am expecting to get artifacts from pull request 59, but instead I am getting artifacts from pull request 60. Maybe I don't understand how the action determines which workflow run to use when downloading artifacts?

Is there a way to protect your self from releasing a release marked as Pre-Release?

I thought GitHub would do this for me, but apparently that isnt the case. Would you be able to add a flag to protect against it?

- name: Download latest Blazor artifact
  if: ${{ null == github.event.inputs.runnumber  }}   
  uses: dawidd6/action-download-artifact@v2
  with:
    workflow: ${{ env.Release_Action_Workflow }} 
    workflow_conclusion: success
    name: Test.Blazor.Wasm
    path: ./web

Support github.event.workflow_run.*

It seems to me that this action would have a natural fit if it was in a workflow that was triggered from another workflow.

Origin Workflow:

name: Test
on: [pull_request]
jobs:
  DoStuff:
    ---

Reporting workflow:

name: Reports
on:
  workflow_run:
    workflows:
      - Test
    types:
      - completed

jobs:
  Report:
    steps:
      uses: dawidd6/action-download-artifact@v2

The github.event.workflow_run context will contain the information about the completed Test workflow. It seems like it would be a more natural approach to leverage the Workflow Syntax to orchestrate this action as opposed to attempting to parameterize it.

See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run

Possibility to download last available artifact from a workflow

Hello
In my workflow 1 uploading my artifact, when the workflow succeed, sometimes a new artifact is uploaded, sometimes not (depending on the result of a given step : if the artifact is unchanged, it is not uploaded in order to avoid to create useless artifacts and spare space).
So, in my workflow 2 downloading my artifact, I would like to download the "latest artifact of the given name uploaded by a successful run of worflow 1 which produced an artifact" (this will not always be the last successful run of worfklow1, because it may not have uploaded any artifact).
I don't think it is possible for the time being. I think it would be an interesting feature.

Allow for option to not fail on no artifacts found

The workflow that this runs on for us may or may not have any artifacts to download due to the previous workflow being a conditional artifact upload. Would it be possible to add an option to allow for the failure and is just set to false by default? We don't want to fail our workflow if no artifacts are found as we're already doing appropriate checks downstream for the expected unzipped directory.

Download artifact from specific run

This looks very close to what I need. I have a workflow that saves an artifact, and then it makes a comment on the PR with details and the Run ID. My plan was to use the Run ID in a second workflow to get hold of the artifact and download it, but that turned out to be a bit too complicated at the moment.

Would it be possible to support supplying a run id to this action?

Feature request: use `workflow_status` with `branch`

It looks like using workflow_conclusion with branch (or pr or commit) is explicitly disallowed:

throw new Error("don't specify `run_id`, `branch`, `pr`, `commit` and `workflow_conclusion` together")

But I'm not seeing why this needs to be the case.

It seems like it could be used as an additional filter with any of branch, pr, commit. It seems like it'd make less sense with run_id but practically it could still be used even with that option.

I can make a PR, but wanted to get validation on this first.

Support use of github.ref env variable

Using ${{ github.ref }} for branch input parameter produces an input formatted as refs/heads/<branch-name>

The code currently expects only <branch-name>

This action should support the use of ${{ github.ref }}

Deprecation warning and failure

Hi, I get the following when trying to use this action.

[@octokit/paginate-rest] "response.data.workflow_runs" is deprecated for "GET /repos/GaryHughes/Exchange/actions/workflows/part_1_cpp.yml/runs". Get the results directly from "response.data"
10
##[error]Cannot read property 'id' of undefined

Empty RunID NotFound (since yesterday)

This action worked like a charm for months now on our repos, but since the big github actions outage yesterday it fails on every build for us.

Screenshot 2021-03-02 at 08 35 12

- name: Download Artifact
   uses: dawidd6/action-download-artifact@v2
   with:
       workflow: ci.build.yaml
       commit: ${{ steps.vars.outputs.commit_hash }}
       name: worknow_backend

Seems like the action is not able to resolve the RunID of the latest build workflow, which worked like it should before yesterday.
Anyone else experiences this issue?

Unable to download artifacts larger than 2^32-1 bytes

Really appreciate the work you've done here!

I've recently been trying to download a 3GB artifact and keep running into this error:
download-artifact-error (2)

I'm fairly certain this is a file size issue as uploading a file exactly 2147483646 bytes in size works fine:
download-artifact-success

I believe this is the line that throws the error

const adm = new AdmZip(Buffer.from(zip.data))

It seems like the Buffer objects can only hold 2^32-1 bytes.

I'd make a fork myself (maybe reading the zip's data as a stream?) but I'm pretty novice with NodeJS. Handling larger files could be a useful option but I understand the project may have other plans.

Thanks!

Error: no artifacts found (but rerun is ok)

I have the same issue #42

My used case is using fountainhead/[email protected] action before using action-download-artifact
I think this is something like a timing issue in github. This is not reproductible on each execution... I had to put a sleep step of 10s before starting downloading artifact (hoping it is ok)

Perhaps a better way would be to manage a retry with a backoff in this action...

Windows-latest workflow: No END header found

Hi there,

I've been using this action for downloading artifacts from previous workflow runs, and have (mostly) successfully used it to replace other download methods. This action is much faster, so I do want to try to make full use of it.

When I say (mostly) successfully, my full test matrix includes ubuntu-latest, macos-latest, and windows-latest: this action works without any issue on ubuntu-latest and macos-latest, but the windows threw the following error:

image

from https://github.com/catalystneuro/nwb-conversion-tools/pull/266/checks?check_run_id=3692022659.

Does this look familiar? Is there something I need to configure on my end? Or is this something that can otherwise be easily fixed?

Thanks for your time

EDIT: I guess the permissions on our actions don't allow others to expand tracebacks. Posted screenshot of issue.

download an artefact from other repo

I'm having a problem with downloading an artifact from another repo by SHA.

this is the code that doesn't work for me:

    - name: Download upstream PointSDK
      uses: dawidd6/action-download-artifact@v2
      with:
        github_token: ${{secrets.GITHUB_TOKEN}}
        workflow: artifact_workflow.yml
        commit: ${{ github.event.client_payload.sha }} # sha to an upstream event from the web-hook
        name: PointSDK
        path: ./Pods/BluedotPointSDK/PointSDK/
        repo: Bluedot-Innovation/point_sdk_ios

It returns

==> Commit: fcbc4eeda46737f2fc1234ec871142c705b9b24a
##[error]Not Found

however, following commands are working as expected:

curl -sL -u UN:PAT https://api.github.com/repos/Bluedot-Innovation/point_sdk_ios/actions/workflows/artifact_workflow.yml/runs | jq -r '.workflow_runs[0].id?'

curl -sL -u UN:PAT https://api.github.com/repos/Bluedot-Innovation/point_sdk_ios/actions/runs/67128363/artifacts

curl -sL -u UN:PAT https://api.github.com/repos/Bluedot-Innovation/point_sdk_ios/actions/artifacts/3637242/zip -o ~/tmp/PointSDK.zip 

Download broken due to deprecated API response

I'm trying to use latest release version (v2.5.0) in order to retrieve artifacts that were previously build with build_artifacts.yml workflow. I can see them and are able to download them manually so I'm sure that artifacts-v1.2.0 exist before running this workflow.

name: Testing my workflow

on:
  push:
    branches:
      - my-feature-branch

jobs:
  test:

    runs-on: ubuntu-18.04
    
    steps:
    - name: Checkout git repository
      uses: actions/checkout@v2

    - name: Download artifact
      uses: dawidd6/[email protected]
      with:
        github_token: ${{secrets.GITHUB_TOKEN}}
        workflow: build_artifacts.yml
        name: artifacts-v1.2.0
        path: artifacts/bin

However, instead of downloading requested artifacts I get the following error response from Github:

2020-05-06T15:37:33.1706727Z ==> Commit: 
2020-05-06T15:37:34.4553787Z [@octokit/paginate-rest] "response.data.workflow_runs" is deprecated for "GET /repos/******/actions/workflows/build_artifacts.yml/runs". Get the results directly from "response.data"
2020-05-06T15:37:37.1867481Z ##[error]Cannot read property 'id' of undefined

Also tried to do the following but none of it didn't help either:

  • running this workflow on one of self-hosted runners
  • changing action version from v2.5.0 to v2
  • removing github_token parameter

Am I missing something here or is that something that needs to be resolved by changing how response is parsed? Thanks in advance!

Unexpected input(s) 'run_number'

I get the following warning when passing the run_number to the action as specified in the documentation.
Screenshot 2021-03-02 at 18 46 37

Example code:

        uses: dawidd6/action-download-artifact@v2
        with:
          workflow: workflow.yaml
          run_number: 111
          name: ios_app

Workflow conclusion input parameters aren't respected

Description

In the README of this repo, we're told that the workflow_conclusion input parameter can be either a (1) workflow conclusion or (2) a workflow status:

    # Optional, the status or conclusion of a completed workflow to search for
    # Can be one of a workflow conculsion::
    # "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
    # Or a workflow status:
    # "completed", "in_progress", "queued"
    # Default: "completed"
    workflow_conclusion: success

However, it seems that when we set workflow_conclusion: success (a workflow status), certain workflow runs (that were successful) are left out.

I haven't been able to verify this, but I suspect passing in other workflow statuses (failure, neutral, etc.) may also behave unexpectedly.

Reproduction

I'm working in a private repository, so details are omitted. But, I've been able to verify that the GitHub API treats the following two queries differently:

/repos/my-org/my-repo/actions/workflows/my-workflow.yml/runs?status=success
/repos/my-org/my-repo/actions/workflows/my-workflow.yml/runs?conclusion=success

In my repo, the former returns 42 results, and the latter 71. It just so happens that the artifact I need falls in the 29 missing results, resulting in not found errors, which is how I stumbled across this bug.

Testing the two queries on this repo:

/repos/dawidd6/action-download-artifact/actions/workflows/upload.yml/runs?status=success       -> 112 results
/repos/dawidd6/action-download-artifact/actions/workflows/upload.yml/runs?conclusion=success   -> 113 results

Not sure why there's such a large disparity in my repo and not yours :)

Where to fix this

const endpoint = "GET /repos/:owner/:repo/actions/workflows/:id/runs?status=:status&branch=:branch"
const params = {
owner: owner,
repo: repo,
id: workflow,
branch: branch,
status: workflow_conclusion,
}

I'll open a PR for this shortly.

handling of download fails

Dear dawidd6,

thanks for your work in the action.
It is really helpful.
One question is there a option to return a Boolean if the artifact was not available and therefore the download was not successful?
Thanks for your help.

Regards

Unable to find remote repo (Error: Not Found)

I’m trying to name the repo I want to download an artifact from. It’s a private repo, so I appreciate that I will need to provide appropriate credentials, but I’m actually getting an error which makes it look like it can’t parse the contents of the repo argument. What format should this be in?

Argument Message from Action Error
repo: https://github.com/user/repo/ ==> Repo: https:/ Error: Not found.
repo: github.com/terrylyons/recombine/ ==> Repo: github.com/terrylyons Error: Not Found
repo: dawidd6/action-download-artifact ==> Repo: dawidd6/action-download-artifact Error: Not Found

(Last example here was just to try it with a public repo which I know exists.)

I’m sure I’m missing something very obvious here, but I can’t figure out how to name in the repo in the repo argument.

Support for wildcard names

Super useful GH action, thank you for providing this to the community!
I'm wondering if supporting wildcards in names would be an useful feature?

For example, in cases like this with many different platforms I'd like to download just the Ubuntu64 artifacts. For example:

- name: Download Palakis latest Ubuntu Build
      uses: dawidd6/action-download-artifact@v2
      with:
        github_token: ${{secrets.GITHUB_TOKEN}}
        workflow: main.yml # "CI Multiplatform Build"
        branch: master
        repo: Palakis/obs-websocket
        name: obs-websocket*amd64.deb
        path: downloads

If this sounds like a great idea, I could try contributing this feature (or let me know if you'll do it instead).

PR number doesn't work

passing PR number to the action seems doesn't work, it doesn't appear in the logs, and always downloads the latest artefact from the given workflow from the latest run, so it takes it from the wrong PR:
Screenshot 2021-05-20 at 12 18 37
but I am passing it:
Screenshot 2021-05-20 at 12 20 44

give an output of the file name

let's say you download to builds/ and that the file name always changes. Could you add something where its an output variable? e.g ${{ steps.download-artifact.outputs.filename}}

Failed to generate URL to download artifact

I was developing my Github Actions workflow & since yesterday I have been seeing the error: "Failed to generate URL to download artifact" (screenshot attached).

Screenshot 2021-03-02 at 5 08 03 PM

My workflow steps for this action are:

      - uses: dawidd6/action-download-artifact@v2
        with:
          workflow: ${{ github.event.workflow_run.workflow_id }}
          name: workflow-package
          path: workflow-package/

Seems like I'm missing something basic. Am I doing something wrong or is this a legitimate issue?

The 'workflow' parameter should be optional

(The action is nice, thank you!)

When run_id is provided, we only need a repository owner/name to perform a request for artifacts list. The action doesn't use the workflow parameter in the case. I think it should be marked as optional.

illegal operation on a directory

In a very simple setup I get:

##[error]EISDIR: illegal operation on a directory, open '/home/runner/work/hello-github-actions/hello-github-actions/.git/logs/refs/remotes/'

What am I doing wrong?

Question: chmod persistence

it seems chmod persistence is a known issue as noted here:
https://github.com/actions/upload-artifact

Permission Loss
exclamation File permissions are not maintained during artifact upload exclamation For example, if you make a file executable using chmod and then upload that file, post-download the file is no longer guaranteed to be set as an executable.

could attempting a "chmod +x" be something that is done by this action perhaps?

no matching workflow run found

Hi, I need help figuring out why I got "no matching workflow run found". I did experiments with this action, in a personal repo, and I got succes. When I integrate this action in my corpo repo, I got the error "no matching workflow run found".

I really triple check if the name of the given workflow parameter is good. I copy/paste it to make sure it is spell correctly.

I've read the code, but can't figure out what's happening.

Kind regards
Martin

      - name: Download backend artifact
        uses: dawidd6/[email protected]
        continue-on-error: true
        with:
          workflow: jerkmate-backend.yml
          workflow_conclusion: success
          commit: ${{ github.sha }}
          name: docker_images
          path: ./jerkmate-backend/docker_images

Artifact not found, but found on rerun

When running a workflow with a job to download an artifact from another workflow (upon the prior workflow completion, not necessarily success) the artifact cannot be found half the time and the workflow fails, but as soon as the workflow is reran the artifact is found. I added a sleep 15s job right before but the artifact still is not found a number of times, until manually reran.

[Proposal] Add support for specifying branch and run_id/run_number together

An example scenario will be if I want to download an artifact using the run_id or run_number that have run against the branch specified.

with:
  workflow: workflow.yaml
  branch: master
  run_number: ${{ github.event.inputs.run_number }}

If the specified run_number or run_id have not run on the branch that was provided an error message should be printed e.g The run_id/run_number do not match the branch specified

Feel free to drop your $0.02 in the comments 😄

Repo Not Found

I may be missing some type of setup but in my workflow, I am getting Error: Not Found
Error:

Run dawidd6/action-download-artifact@v2
  with:
    workflow: ./test.yaml
    workflow_conclusion: success
    path: cagedstyle-raven
    repo: rogerprz/WorkflowTest2
    github_token: ***
==> Repo: rogerprz/WorkflowTest2
Error: Not Found

Repo Link

name: Download Workflow Artifact

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:

  build:
    runs-on: windows-latest  # For a list of available runner types, refer to

    steps:
    - name: Download Workflow Artifact
      uses: dawidd6/action-download-artifact@v2
      with:
        # Required, workflow file name or ID
        workflow: ./test.yaml # project name

        # SELECTOR
        # Optional, the conclusion of a completed workflow to search for
        # Can be one of:
        # "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
        # Ignores conclusion by default (thus using the most recent completed run when no other option is specified, regardless of conclusion)
        workflow_conclusion: success

        # Error: don't specify `run_id`, `branch`, `pr`, `commit` and `workflow_conclusion` together
        # RESEARCH        
        # pr: ${{github.event.pull_request.number}} # Optional, will get head commit SHA
        # commit: ${{github.event.pull_request.head.sha}} # Optional, no need to specify if PR is
        # branch: master # Optional, will use the branch
        # run_id: 1122334455 # Optional, will use specified workflow run

        # RESEARCH
        # Optional, uploaded artifact name,
        # will download all artifacts if not specified
        # and extract them in respective subdirectories
        # https://github.com/actions/download-artifact#download-all-artifacts
#         name: artifact_name

        # TARGET DIRECTORY || nil
        # Optional, directory where to extract artifact
        path: cagedstyle-raven
        repo: rogerprz/WorkflowTest2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.