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

Interpolation of variables #13

Open
tenhobi opened this issue Oct 10, 2019 · 15 comments
Open

Interpolation of variables #13

tenhobi opened this issue Oct 10, 2019 · 15 comments
Labels
question Further information is requested

Comments

@tenhobi
Copy link
Contributor

tenhobi commented Oct 10, 2019

In the

https://github.com/ad-m/github-push-action/blob/master/action.yml#L12
and
https://github.com/ad-m/github-push-action/blame/master/README.md#L35

there is interpolation used as {{ secrets.GITHUB_TOKEN }} and ${GITHUB_REPOSITORY}.

From the docs I think it should be ${{ <expression> }}. Should we change it to make it right?

@tenhobi tenhobi added the question Further information is requested label Oct 10, 2019
@ad-m
Copy link
Owner

ad-m commented Oct 10, 2019

Yes.

Is there a solution that would synchronize the documentation with the manifest, so that we would be in compliance in the future?

@tenhobi
Copy link
Contributor Author

tenhobi commented Oct 10, 2019

That would be possibly only by running some script manually each time, or by running Action what whould parse the yaml to the right markdown part.

For example you would put some tag like this below to the README and the Action would insert new content to it each time on push to master.

<div action-inputs></div>

And it could work for other data from that file too.

That might be interesting, in fact, will we do something like that?

@tenhobi
Copy link
Contributor Author

tenhobi commented Oct 10, 2019

On the other hand, I can see no repository which has mentioned its inputs in README. :/

@ad-m
Copy link
Owner

ad-m commented Oct 10, 2019

I would not see it as a single tag, but a separate section <!-- action-doc-start-->...<!-- action-doc-end-->, which the script would automatically fill. In the event of a change, the script would change the content of the section, and our action could automatically commit the changes. In the absence of any changes, the script would not change the content of the section, so there would be no changes to be posted.

It's possible that others are waiting for GitHub to properly document this.

@tenhobi
Copy link
Contributor Author

tenhobi commented Oct 10, 2019

Maybe we should also wait for final version. Not it's in alpha, beta or something. :-)

@ad-m
Copy link
Owner

ad-m commented Oct 10, 2019

@damccorm are you aware any plans in area of GitHub-provided documentation for actions inputs? Can you share them so that we can decide if it's worth working on it?

@damccorm
Copy link

Not that I know of, @rachmari would probably know better than I

@rachmari
Copy link

@ad-m we plan to write a short guide that will show people writing a workflow how to use inputs and outputs. For example, it would show you how to supply an action in a workflow with its required inputs and retrieve the output from that action. We'll also explain how a someone developing an action can use inputs and set outputs. We already do that a bit in these two guides:

We recommend that anytime you create an action that you include the inputs and outputs that the action requires in the README file of the repository. We are working on ensuring that all repositories in the github.com/actions organization also follow those best practices. You can see an example README that declares the required or optional inputs/outputs here.

Let me know if you have any more questions. ✨

@ad-m
Copy link
Owner

ad-m commented Oct 10, 2019

So there is no plan to parse action.yml by GitHub, if I understand correctly. Users have to convert action.yml to README by self, not as part eg. GitHub Marketplace of GitHub Actions.

@rachmari
Copy link

That's a great question. I'm not sure if we plan to do that for actions in Github Marketplace. @ethomson do you know the plans for that?

@ad-m
Copy link
Owner

ad-m commented Oct 10, 2019

In my opinion - since action.yml contains all necessary information, there is no reason for users to manually write documentation in regard of input and output. It is prone to erroneous and difficult to automatically verify. If GitHub Marketplace for GitHub Actions will not automatically present the information currently contained in action.yml, we will have to update README.md automatically eg. by another actions. PR #14 is an example that content in README.md and action.yml is duplicated and therefore prone to errors.

@ethomson
Copy link

We're thinking about a change to take the action.yml and show some information in the GitHub Marketplace about how to use an action based on that.

@ethomson
Copy link

If we do this, though, it will be a display of the data in the action.yml only. It's not meant as a replacement for your README, which can show a full workflow, including applicable runs-on environments, preconditions like actions/checkout, etc. That information isn't in the action.yml, so I don't think you should think of this behavior in the GitHub Marketplace as removing the need for a good sample workflow.

@ad-m
Copy link
Owner

ad-m commented Oct 10, 2019

In my opinion, OpenAPI is a good example of documentation that is machine-processable (suitable for visualization) but understood by human. I suggest analyse how this specs provides for the possibility of placing examples (purely for information purposes). As I know action.yml can not contains examples.

If GitHub Marketplace for GitHub Actions will provide a convenient API for information in action.yml, in addition to visualizing this information, you will be able to integrate this solution with editors to get automatic hints on the parameters provided by the actions.

@ad-m
Copy link
Owner

ad-m commented Oct 10, 2019

Thank you for the information that GitHub plans to publish in an attractive way information about "input" and "output". In this case, we can stop our work on automatically updating README.md based on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants