Skip to content

Instantly share code, notes, and snippets.

@lpsm-dev
Created June 6, 2024 03:35
Show Gist options
  • Save lpsm-dev/5d31f0dd0b9e60131577a99a1b2cf23f to your computer and use it in GitHub Desktop.
Save lpsm-dev/5d31f0dd0b9e60131577a99a1b2cf23f to your computer and use it in GitHub Desktop.
[GitHub Actions] - Describe best practices for creating actions

It's essential to follow best practices when creating actions:

  • Create chainable actions. Don't create large monolithic actions. Instead, create smaller functional actions that can be chained together.
  • Version your actions like other code. Others might take dependencies on various versions of your actions. Allow them to specify versions.
  • Provide the latest label. If others are happy to use the latest version of your action, make sure you provide the latest label that they can specify to get it.
  • Add appropriate documentation. As with other codes, documentation helps others use your actions and can help avoid surprises about how they function.
  • Add details action.yml metadata. At the root of your action, you'll have an action.yml file. Ensure it has been populated with author, icon, expected inputs, and outputs.
  • Consider contributing to the marketplace. It's easier for us to work with actions when we all contribute to the marketplace. Help to avoid people needing to relearn the same issues endlessly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment