-
Notifications
You must be signed in to change notification settings - Fork 503
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
Warning: pre
execution is not supported for local action from './'
#564
Comments
Hello! Apologies for the delay in responding to this issue. Currently, referencing the action locally will not let the
You could reference the action in a workflow file like this: jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: <owner>/<repo>/my-action@main This should let |
I don't think that is equivalent, e.g. how can we make the github actions testable, especially for forks. |
This workaround makes it impossible to test changes to an action in the repo in which it's developed, which I imagine is a very common use case for folks who are writing and referencing local actions. It'd work if one could write Can someone from GitHub explain why |
I did some checking internally to see why As far as testing the action, you should be able to reference either your fork repo or branch name without issue: - uses: <owner>/<fork-repo>@main
- uses: <owner>/<action-repo>@<feature-branch> Are there specific errors you're running into when testing actions in a fork or branch? I'd be happy to dig into it if you have a reproducible example |
Closing due to lack of activity. If you'd like to revisit this please open a new issue and provide any additional details that may be useful :) |
There is no activity because the request is clear. We need it for relative path. That's the form that works for gh actions to allow PRs, otherwise whenever a new PR is made, they need to point the unit tests to their fork, run the tests and point them back to the original repo before merging |
Apologies! I misunderstood the request :/ I was able to find more info here. In particular: Action referenced from local repository ( As far as current workarounds, yes you can fork the action repo, update the workflow to reference the forked repo name, and then update to the original repo name before submitting the PR. Another option would be to convert to a composite action and move the runs:
using: 'node12'
pre: 'lib/setup.js'
main: 'lib/main.js'
I created a trivial reproduction here if that helps. The benefit there is you shouldn't need to rename anything when forking and making updates. |
Sorry, but this sounds luke bs on their side. Why can't the pre be delayed for after git checkout, and why would the delay not have a similar effect on the repo reference approach?
That is the approach I've converged to, but I don't like it because it wraps all of the stdout to composite-like output. |
Yeah I don't understand this one either. So the idea is that, if you want a native Github Action that uses |
So... I looked a bit... @zijchen I filed github/docs#34029 to address the fact that the documentation didn't warn you about the problems you'd encounter (it's heartening to see people reading documentation). As an example of why someone would add a Azure/login#384 added a If you had Note that this code/behavior actually lives in the runner: https://github.com/actions/runner/blob/2a7f327d93fb79326c974f4858ce62c3b81c580a/src/Runner.Worker/ActionRunner.cs#L108 and thus discussion doesn't really belong here. I'm here because some random local action in microsoft/playwright uses azure/login and triggers this same warning. In order to make things easier for me (as I'm liable to trip on this elsewhere, and in fact, I'm pretty sure I have in the past), I've filed: actions/runner#3397 If people are unhappy with the behavior or want different behavior, actions/runner is the repository to poke. |
@ca-scribner: I'm with you. In general, anyone using |
I am one of the contributors for Azure/sql-action, and we have a workflow defined here that uses
./
to run our action and test some functionalities. I followed this guide to add apre
script for some setup code, like this:But in our workflow, it seems like that is ignored
Is there a way to execute the
pre
script even for using./
?A workaround would be to move the
pre
script into our main function, but we'd like to keep the setup code separate if possible.The text was updated successfully, but these errors were encountered: