What is an Action?

For your GH Actions workflow steps, normally you just write shell commands.

To set up your language environment and to perform complex tasks, you’ll often end up using an action from the GH Actions Marketplace.

An action is a repo on GitHub that is properly packaged to run in a workflow and is written in TypeScript or using Docker.

You can use any repo but only ones that have been approved by GitHub make it to the Marketplace where they can be searched for. They also get a Marketplace doc page, which comes from the repo’s README.md file.

How to use an Action

An Action exists as a public repo on GitHub.

GitHub provides many actions under a certain account:

For example:

Use one like this:

steps:
  - uses: actions/checkout@v2

  - uses: actions/setup-node@v2
    with:
      node-version: '12'

You can reference an action in a subdirectory like this.

Based on cancel-outdated-builds insructions.

- name: Cancel outdated builds
  uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master