Skip to content
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

runs.pre should mention that it doesn't work from local actions or when called from other actions called from local actions #34029

Open
1 task done
jsoref opened this issue Jul 19, 2024 · 7 comments
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team help wanted Anyone is welcome to open a pull request to fix this issue SME reviewed An SME has reviewed this issue/PR

Comments

@jsoref
Copy link
Contributor

jsoref commented Jul 19, 2024

Code of Conduct

What article on docs.github.com is affected?

https://github.com/github/docs/blob/main/content/actions/creating-actions/metadata-syntax-for-github-actions.md#runspre

What part(s) of the article would you like to see updated?

runs.pre should include a paragraph explaining availability caveats.

It should mention:

  1. pre doesn't work from local actions
  2. If you create an action that will be used by other actions that might in turn be used by local actions, you'll trigger warnings in all workflows that use that action.
  3. that better practice involves creating a secondary action containing the pre phase so it can optionally be used at the discretion of consumer actions/workflows.

Additional information

Documentation here would have helped since at least @zijchen would have known that it wasn't going to work.

Documentation here might have also discouraged people from adding pre to actions.

Instead, the right behavior which should be recommended in resolving this ticket is to provide a second action in the same repository responsible for the pre behavior.

Thus, instead of @MoChilia in Azure/login#384 changing azure/login to have a pre thing which triggers warnings as noted in actions/runner#3397, @MoChilia could have created azure/login/clear-credentials which does the work that's currently included in pre. Then users could do:

  • uses: azure/login/clear-credentials@...
  • uses: azure/login@...
  • uses: azure/login@...

And groups like microsoft/playwright could uses: azure/login@... without triggering dozens of warnings.

Fwiw. I'm pretty sure I've run across other repositories causing similar headaches in the past. It's really frustrating, and given that it appears some actions authors really do refer to documentation, documentation is the right place to put advice to avoid this problem.

@jsoref jsoref added the content This issue or pull request belongs to the Docs Content team label Jul 19, 2024
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Jul 19, 2024
@nguyenalex836 nguyenalex836 added actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team labels Jul 19, 2024
@nguyenalex836
Copy link
Contributor

@jsoref Thanks for opening an issue - I'll get this triaged for review ✨

@Bamag235

This comment was marked as off-topic.

@sunbrye sunbrye added the needs SME This proposal needs review from a subject matter expert label Jul 25, 2024
Copy link
Contributor

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀

@sunbrye
Copy link
Contributor

sunbrye commented Jul 25, 2024

Can the SME confirm whether points 1, 2, and 3 are caveats that should be documented?

Copy link
Contributor

This is a gentle bump for the docs team that this issue is waiting for technical review.

@github-actions github-actions bot added the SME stale The request for an SME has staled label Aug 23, 2024
@nguyenalex836 nguyenalex836 removed the SME stale The request for an SME has staled label Aug 23, 2024
@nguyenalex836 nguyenalex836 removed the waiting for review Issue/PR is waiting for a writer's review label Sep 4, 2024
@nguyenalex836 nguyenalex836 added help wanted Anyone is welcome to open a pull request to fix this issue SME reviewed An SME has reviewed this issue/PR and removed needs SME This proposal needs review from a subject matter expert labels Oct 2, 2024
@nguyenalex836
Copy link
Contributor

@jsoref Thank you very much for your patience while our team reviewed! They responded with the following -

pre doesn't work from local actions
Its worth noting this on pre, a notice such as pre is not supported for local actions, would be sufficient there.

As for the other two bullet points, those feel really specific to what the user is trying to do. They are technically correct, but I wouldn't recommend documenting them. The first notice should be sufficient, and users can work around that if needed. Local actions are a very niche use case compared to pre

I've added the help wanted label so that you, or anyone else, can add the pre is not supported for local actions note to the docs ✨

CC @sunbrye just for visibility 💛

@SuperSaleng

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team help wanted Anyone is welcome to open a pull request to fix this issue SME reviewed An SME has reviewed this issue/PR
Projects
None yet
Development

No branches or pull requests

5 participants