Comments (8)
Try specifying pr
input instead of branch
.
from action-download-artifact.
Only the branch is known to the workflow. It knows nothing about the pull request number or run id in the other project. This is why am trying to use this action. So, how do you search for the latest pr number or run id using the branch name (I am pretty new to github)? For manual builds, this action works great, but I am trying to do continues builds, where projects are triggering other projects after being successfully built and where developers are making related changes in multiple projects and are expecting their changes to all build.
I have yet to find a way for one project to search another project for the correct artifacts based on branch name and workflow. Originally, I was loading the successful builds run_id in an artifact called run_id-<branch_name>.txt and then searching for the latest run_id-<branch_name>.txt (using aochmann/[email protected]); downloading the file, unzipping it, and using the run_id to pull the artifacts from the other project. This was a work-around that I did not like, I thought this action would be a better solution.
from action-download-artifact.
Will using git hash work? I maybe able to query the repository by branch name and get the git hash.
from action-download-artifact.
There is a commit
input for that.
from action-download-artifact.
I am in the process of trying to use:
curl -sH "Accept: application/vnd.github.v3+json"
-u ${{ secrets.CURL_TOKEN }} -o curl_output.txt
https://api.github.com/repos/SKuhlmanns/steves-test-repo/branches/${{ github.base_ref }}
to query and get the branch information and then parse out the head git hash in curl_output.txt into a environment variable called " LIB_COMMIT_HASH" and using it in the action:
commit: ${{env.LIB_COMMIT_HASH}}
Am I complicating things or am I on the right track?
from action-download-artifact.
I am expecting to get artifacts from pull request 59, but instead I am getting artifacts from pull request 60.
This seems odd. I would search for the issue here rather than creating some hacks. Something must be wrong with the branch name. Can't say what exactly, would need to dive deeper into this and I won't dedicate my time for that right now. Maybe try executing the Action locally with proper parameters and debug.
from action-download-artifact.
I think the problem with using the branch name is that I have two or more branch names that are similar (for example ("sjk-LDV-648" and "sjk-LDV-648-2") and I am specifically looking for artifacts for "sjk-LDV-648" and "sjk-LDV-648-2" is the last build; it gives me artifacts for "sjk-LDV-648-2". Whereas a git hash is unique and will never find two matches. I noticed that filtering from the github GUI on the workflow runs with "branch:sjk-LDV-648" gives me runs with branch names: "sjk-LDV-648-2", "sjk-LDV-648-2" and "sjk-release_v4.4-LDV-648" and "bugfix/sjk-release_v4.4-LDV-648", etc.... The GUI is searching/filtering based on <branch_name>. Not sure this has anything to do with your action, but my solution above to use curl to search for the head git hash of the dependent repository branch is working as far as I can tell. More testing will be needed.
Forgive me, but I am not a developer and know nothing about jscript. My primary language development is bash and scripting languages. I don't even know why the workflow file name is required in the action. I assume it isolates runs to the named workflow and ignores the other runs. I also assume that the repo: parameter forces the action to run on the named (target) repo instead of the calling (default) repo. So, your comment about "... try executing the Action locally with proper parameters and debug" is over my head. I would not know where to begin. So, I usually implement things that I understand which seems like hacks to real developers.
You can close the ticket if you think this is more my problem than a problem with the action. I appreciate your help.
from action-download-artifact.
Your observations about branch filtering in UI might be correct. I guess that's just how things work on GitHub's side. I don't see anything I could do here tho. Closing then.
from action-download-artifact.
Related Issues (20)
- Error: no downloadable artifacts found (expired) HOT 2
- Download artifacts for tag HOT 1
- Ignore forks
- `no matching workflow run found` error in a complex scenario HOT 1
- Error: no artifacts found HOT 2
- CodeQL scanning alerts HOT 3
- Looking for contributors HOT 2
- `GLIBC_2.28' not found HOT 2
- `/lib64/libm.so.6: version 'GLIBC_2.27' not found` in my self-hosted runners (Amazon Linux 2) HOT 21
- Avoid create folder when upzip artifact HOT 2
- Workflow Run Referenced an Incorrect Artifact HOT 4
- Unable to get artifacts from other workflows/runs HOT 9
- Ignore forks should be `true` by default
- Looking for contributors
- Error: The value of "options.maxOutputLength" is out of range. It must be >= 1 and <= 4294967296. Received 0 HOT 2
- - HOT 1
- Make sure the value of Authorization header is formed correctly including the signature. HOT 1
- docs: update `actions/download-artifact` reference
- Space based workflow won't download artifacts HOT 1
- artifact timestamp is not restored
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-download-artifact.