-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use this in a composite action? #322
Comments
The path is relative to the current working directory, which isn't the same as the directory where the composite action was checked out. I don't know the right path at the top of my head, but it might be inside
👍 Good idea, I've enabled discussions. |
@PaulRBerg
So maybe something like this will work: uses: "actions/github-script@v6"
with:
script: |
const script = require("${{github.action_path}}/dist/index.js")
script({core}) |
Oh, yes. This was exactly what I needed. Thanks for digging this up, Josh! |
Perfect answer, just what I was looking for, thanks @joshmgross! |
I’m looking to create a composite action, and the task that I’m working on would be easiest to implement by doing some work in JavaScript and some other work in a Bash script. Can I use this action (github-script) to achieve this?
I added this to my action:
But then I got this error when I ran it:
What am I doing wrong?
Side note - why not enable discussions in this repository?
The text was updated successfully, but these errors were encountered: