GithubHelp home page GithubHelp logo

Comments (12)

bryanmacfarlane avatar bryanmacfarlane commented on September 26, 2024 3

You're referencing master which is the coding branch. You should reference a distribution branch. The distribution branch contains a fully self contained set of code.

https://github.com/actions/toolkit/blob/master/docs/action-versioning.md

This template and walkthrough has you checking in production dependencies.

The runner downloads the files at the location and ref and runs it. That's it.

In the example above ^^ you're referencing master which is the coding branch and doesn't have production runtime dependencies.

npm install is a dev build time action. distributions are self contained.

covered in readme walthrough: https://github.com/actions/javascript-action#publish-to-a-distribution-branch

from javascript-action.

lannonbr avatar lannonbr commented on September 26, 2024 1

Another solution to not push node_modules into git is to use a bundler like webpack, parcel, etc

from javascript-action.

wesleytodd avatar wesleytodd commented on September 26, 2024 1

Ok, thanks I was able to reporduce:

https://github.com/wesleytodd/actions-testing/commit/7b6d9d97d9298bf57b07bdaab2f2c0956d11e85b/checks

from javascript-action.

bryanmacfarlane avatar bryanmacfarlane commented on September 26, 2024 1

I will write up a public document soon on the toolkit repo with the GPR proposal which we will start soon ...

from javascript-action.

fabiankaegy avatar fabiankaegy commented on September 26, 2024

just ran into the same thing and agree that this should be handled by the platform :)

from javascript-action.

wesleytodd avatar wesleytodd commented on September 26, 2024

https://github.com/wesleytodd/actions-testing/commit/73159469ab560d08f64e59a61fbe64d65764057a/checks

I used the template, and then pushed a commit, the action ran fine. Can you all who are seeing this issue provide more context?

from javascript-action.

danielkatz avatar danielkatz commented on September 26, 2024

https://github.com/wesleytodd/actions-testing/commit/73159469ab560d08f64e59a61fbe64d65764057a/checks

I used the template, and then pushed a commit, the action ran fine. Can you all who are seeing this issue provide more context?

Since your action is in the same repo as the workflow, you can run npm ci on your action. This approach isn't applicable for published public actions.

from javascript-action.

danielkatz avatar danielkatz commented on September 26, 2024

Another solution to not push node_modules into git is to use a bundler like webpack, parcel, etc

The same problem, if i'll use a bundler, i'll have to publish the bundled code to the repo.

from javascript-action.

wesleytodd avatar wesleytodd commented on September 26, 2024

https://github.com/wesleytodd/actions-testing/commit/e0ca2a86035790823447e1288f722c1908b762e5/checks

This run was against this template. And it also worked.

from javascript-action.

danielkatz avatar danielkatz commented on September 26, 2024

https://github.com/wesleytodd/actions-testing/commit/e0ca2a86035790823447e1288f722c1908b762e5/checks

This run was against this template. And it also worked.

You as a user of an action can run npm ci to make it work. But as a publisher of an action, you can't run npm ci on your action because of syntax limitations, so you have to rely on the user to run it for you, which isn't the best UX...

from javascript-action.

bryanmacfarlane avatar bryanmacfarlane commented on September 26, 2024

The requirement is to be able to reference the distribution to run by an immutable reference (sha) or ref.

We have an enhancement that we're targetting hopefully for later this year where a workflow can reference from GPR (packaging)

from javascript-action.

bryanmacfarlane avatar bryanmacfarlane commented on September 26, 2024

Until we get to GPR, we found a better mitigated solution. #5

from javascript-action.

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.