Code Monkey home page Code Monkey logo

Comments (18)

rogchap avatar rogchap commented on September 21, 2024 2

Thanks @peter-evans
I hope you don't mind, but I took your python script to call this manually for now.
One small change i made that may be particular to my case: is because I'm building for multiple platforms, I want to raise multiple PRs (or all in one PR) and due to the branch names being based on the hash I get a conflict.
Your check for the branch is in origin already pr_branch_exists will always return false because these jobs are run in parallel and without calling git fetch first the new branch will never be in the remotes.origin.refs
So I changed this to use a timestamp instead ๐Ÿคทโ€โ™‚
You can see my implementation here if it helps:
https://github.com/rogchap/v8go/blob/master/.github/workflows/v8build.yml

PS. thanks for a great Action

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024 2

Confirmed that, currently, container actions only work on Linux virtual environments. The only way to make Mac OSX and Windows actions right now is a new Javascript actions format that was introduced with Actions v2.
https://help.github.com/en/articles/about-actions#types-of-actions

The options currently are very limited and Actions are still not GA yet, so I imagine that there are more features coming to support other platforms. This action can be made usable very easily if either:

I will reach out to GitHub support and try and find out what direction they are likely to take in the near future.

By the way, I should point out that the majority of the actions currently on the Marketplace are container based actions because they were written during the Actions v1 beta when that was the only option. So none of those will work on Mac OSX and Windows either.

Update: I've discovered a way to make this action work on all three platforms without needing to rewrite it completely. Working on a test release.

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024 2

I've released a beta version of the multi-platform action. Please test it out.

    - name: Create Pull Request
      uses: peter-evans/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@rogchap I've added an extra parameter BRANCH_SUFFIX that if set to timestamp will use timestamps to suffix the branch names instead of the short SHA1 hash. (By the way, during testing I still got an unlucky clash when using timestamps, so I might add a further option to randomise a suffix)

I'm not sure what direction GitHub are going to take in the future to support multi-platform actions. I will probably leave the original action and multi platform action implementations separate until it becomes clear.

from create-pull-request.

AraHaan avatar AraHaan commented on September 21, 2024 2

So basically to make an ruby-action I would have to convert the code under https://github.com/actions/setup-ruby for it and tell it to use that instead of python ๐Ÿ‘Œ

from create-pull-request.

simondelphia avatar simondelphia commented on September 21, 2024 2

Seems then the reason why I was getting this error was actually because of swift-package-dependencies-check which I was trying to use together with this one. I assumed this PR action was the reason for the error but when I removed the pull request step I still got the same error. The logs made it unclear which one was causing the problem before that.

Thank you!

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

Thank you for raising this. I wasn't aware that it doesn't work on Mac OSX and Windows. I will look into this and see if it's feasible to make it multi-platform.

from create-pull-request.

rogchap avatar rogchap commented on September 21, 2024

Thanks for jumping on this so fast @peter-evans I will give the update a try and provide feedback. thanks again.

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

@rogchap I'm going to close this issue for now. If you have any problems with the -multi versions of this action please create a new issue. Thanks!

from create-pull-request.

rogchap avatar rogchap commented on September 21, 2024

No worries @peter-evens; I havenโ€™t had a chance to test yet; but will.

from create-pull-request.

AraHaan avatar AraHaan commented on September 21, 2024

@peter-evans how exactly did you make this work? I made an action myself 2 days ago using an old v1 action as a guide to add more features to it and would like to fix this same issue.

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

Hi @AraHaan

I made an action myself 2 days ago using an old v1 action as a guide

Is it a container-based action? If so, you still can't use container-based actions cross-platform. They only work on linux VMs. The only solution that I know of is to convert the action to Javascript.

from create-pull-request.

AraHaan avatar AraHaan commented on September 21, 2024

Welp that would be hard as it is in using this code atm https://github.com/Elskom/merge-dependabot/blob/main/entrypoint.sh
I changed a few lines of some other action to basically do what I wanted it to do.

I did try on my project having it use linux however .NET Core does not like building a project that imports the WindowsDesktop SDK on linux. ๐Ÿ’ฏ

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

If a complete rewrite to Javascript/Typescript is not feasible, the only other suggestion I have is to make a Javascript wrapper action which executes whatever tooling you need to run. For an example of what I mean, see python-action, which is a wrapper around executing Python in a cross-platform way. That's how I originally made this action work cross-platform, but eventually I just rewrote it from scratch.

from create-pull-request.

AraHaan avatar AraHaan commented on September 21, 2024

@peter-evans so what do I do to make the setup-ruby into an single js file?

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

Multiple versions of Ruby are available in the GitHub Actions tool-cache. So all setup-ruby does is find the path in the cache to the version of Ruby that the user has requested.

These two lines are finding the version in the cache and building the correct path to the binary. If you run these when your action starts you should have a path to the Ruby binary that you can call to execute your script.
https://github.com/actions/setup-ruby/blob/main/src/cache.ts#L6-L8

from create-pull-request.

simondelphia avatar simondelphia commented on September 21, 2024

It the version identifier still 1.3.1-multi?
Still get the error about Linux after switching.

Download action repository 'peter-evans/[email protected]' (SHA:0fe13446aa550b789d50dc39ea9e8e7067e1ed67)
Container action is only supported on Linux, skip pull and build docker images.

from create-pull-request.

AraHaan avatar AraHaan commented on September 21, 2024

@peter-evans it is possible to have javascript bootstrap the python code to the action itself and act as an proxy (I would totally do that if I plan to eventually write my github action in .NET).

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

@simondelphia This is an old issue and 1.3.1-multi is a very old version of the action! I rewrote the action in Typescript and now all versions >2 are multi platform. Please use the latest version of this action.

from create-pull-request.

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.