Giter Club home page Giter Club logo

Comments (8)

dawidd6 avatar dawidd6 commented on August 28, 2024

Try specifying pr input instead of branch.

from action-download-artifact.

SKuhlmanns avatar SKuhlmanns commented on August 28, 2024

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.

SKuhlmanns avatar SKuhlmanns commented on August 28, 2024

Will using git hash work? I maybe able to query the repository by branch name and get the git hash.

from action-download-artifact.

dawidd6 avatar dawidd6 commented on August 28, 2024

There is a commit input for that.

from action-download-artifact.

SKuhlmanns avatar SKuhlmanns commented on August 28, 2024

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.

dawidd6 avatar dawidd6 commented on August 28, 2024

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.

SKuhlmanns avatar SKuhlmanns commented on August 28, 2024

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.

dawidd6 avatar dawidd6 commented on August 28, 2024

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)

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.