GitHub Action runner buildspec reference
This topic contains the buildspec reference for GitHub Action runner properties.
steps
Optional sequence. Steps are used to run commands and actions in CodeBuild. For more information, see GitHub Action runner in Amazon CodeBuild.
Note
Each build phase supports either a list of commands
or a list of steps
, but
both cannot be used in the same phase.
Each build step contains the following properties.
- id
-
Optional. The identifier for the step that can be used to reference the step in other contexts
. - if
Optional. A conditional statement that can be used to prevent a step from running unless a condition is met. This statement can use any supported context
, such as referencing environmental variables from CodeBuild, as well as expression . - name
-
Optional. The name for the step. If the name isn't specified, the name will default to the text specified in the
run
command. - uses
-
The action that runs for the step. Some actions require you to set inputs using
with
. Reference the action's README to determine which inputs are required. For more information, see Which GitHub Actions can I use?.If
uses
is specified in your build phase, it can't be used withrun
.Note
It's recommended that you include the version of the action you are using. This can be done by specifying a Git ref, SHA, or Docker tag. For more information, see steps.uses syntax
. - run
-
A command that runs command-line programs. These can be single-line commands or multi-line commands. By default, these commands run using non-login shells. To choose a different shell, use
shell
.If
run
is specified in your build phase, it can't be used withuses
. - shell
-
Optional. The shell specified for this sequence. For supported shell parameters, see steps.shell
. If unspecified, the shell used is bash. If bash is unavailable, sh is used. - with
-
Optional. A map of input parameters defined by the action. Each parameter is a key/value pair.
- with.args
-
Optional. A string that defines inputs for a Docker container.
- with.entrypoint
-
Optional. The Docker entrypoint specified for the Dockerfile.
- env
-
Optional. The variables specified for steps to use in the environment.
- continue-on-error
-
Optional. A Boolean value that indicates if a failure of this step sequence can be ignored.
false
-
The default value. If this step sequence fails, the build will fail.
true
-
If this step sequence fails, the build can still succeed.
- timeout-minutes
-
Optional. The maximum number of minutes the step can run for before terminating. By default, there is no timeout. If the step timeout exceeds the build timeout, the step will stop when the build timeout is reached.
The following is an example using the Super-Linter
version: 0.2 phases: build: steps: - name: Lint Code Base uses: github/super-linter@v5 env: VALIDATE_ALL_CODEBASE: true USE_FIND_ALGORITHM: true FILTER_REGEX_INCLUDE: '/github/workspace/buildspec.yml'