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

Add action typings #744

Closed
wants to merge 1 commit into from
Closed

Add action typings #744

wants to merge 1 commit into from

Conversation

krzema12
Copy link

@krzema12 krzema12 commented Aug 30, 2023

Closes #591.

This change introduces typings for the action's API using https://github.com/typesafegithub/github-actions-typing, along with a workflow that cross-validates them with action.yml. It helps both humans and machines reason about the API of the action in a standardized, readable way. You can also think of it as an additional linter or documentation tool.

Adoption notes:

  • this mechanism is already fully functional, and is used by approx. 30 actions: https://github.com/typesafegithub/github-actions-typing/network/dependents
  • it currently uses Kotlin and its JVM target, and building the docker image every time the action is run is surplus. If we decide to introduce the typings here in this template, I'm open to changing the approach to make it less resource-intensive, e.g. by prebuilding the Docker image, using JS runtime, or yet another way

Testing done

Checked in my fork that the new workflow succeeds, see https://github.com/krzema12/typescript-action/actions/runs/6022936242/job/16338691428

Screenshot 2023-08-30 at 11 16 42

@ncalteen
Copy link
Collaborator

ncalteen commented Sep 1, 2023

Hi @krzema12, thanks for introducing me to typesafegithub/github-actions-typing! This is an interesting project :)

At this time, we're not going to introduce this into the template repository. We do not want to add in third party actions because this can affect the ability of GitHub Enterprise Cloud users to make use of this repository. For example, administrators may enforce a policy restricting the types of third-party actions that may be run on repositories in the enterprise.

@ncalteen ncalteen closed this Sep 1, 2023
@ncalteen ncalteen self-assigned this Sep 1, 2023
@krzema12
Copy link
Author

krzema12 commented Sep 1, 2023

@ncalteen have you considered introducing typings as a first-party feature that would be checked by GitHub itself, without auxiliary actions?

@ncalteen
Copy link
Collaborator

ncalteen commented Sep 1, 2023

I like the idea! I will check about submitting this as a feature request :)

@krzema12
Copy link
Author

krzema12 commented Sep 1, 2023

@ncalteen would be really cool! I've opened this thread some time ago, with not much traction: https://github.com/orgs/community/discussions/32054

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

Successfully merging this pull request may close these issues.

Add typing + validation workflow
2 participants