Amazon CodeCatalyst is no longer open to new customers. Existing customers can continue to use the service as normal. For more information, see How to migrate from CodeCatalyst.
'GitHub Actions' action YAML
The following is the YAML definition of the GitHub Actions action.
This action definition exists as a section within a broader workflow definition file. For more information about this file, see Workflow YAML definition.
Choose a YAML property in the following code to see a description if it.
Note
Most of the YAML properties that follow have corresponding UI elements in the visual editor. To look up a UI element, use Ctrl+F. The element will be listed with its associated YAML property.
# The workflow definition starts here.
# See Top-level properties for details.
Name: MyWorkflow
SchemaVersion: 1.0
Actions:
# The action definition starts here.
action-name:
Identifier: aws/github-actions-runner@v1
DependsOn:
- dependent-action-name-1
Compute:
Fleet: fleet-name
Timeout: timeout-minutes
Environment:
Name: environment-name
Connections:
- Name: account-connection-name
Role: iam-role-name
Inputs:
Sources:
- source-name-1
- source-name-2
Artifacts:
- artifact-name
Variables:
- Name: variable-name-1
Value: variable-value-1
- Name: variable-name-2
Value: variable-value-2
Outputs:
Artifacts:
- Name: output-artifact-1
Files:
- github-output/artifact-1.jar
- "github-output/build*"
- Name: output-artifact-2
Files:
- github-output/artifact-2.1.jar
- github-output/artifact-2.2.jar
Variables:
- variable-name-1
- variable-name-2
AutoDiscoverReports:
Enabled: true | false
ReportNamePrefix: AutoDiscovered
IncludePaths:
- "**/*"
ExcludePaths:
- node_modules/cdk/junit.xml
SuccessCriteria:
PassRate: percent
LineCoverage: percent
BranchCoverage: percent
Vulnerabilities:
Severity: CRITICAL|HIGH|MEDIUM|LOW|INFORMATIONAL
Number: whole-number
Reports:
report-name-1:
Format: format
IncludePaths:
- "*.xml"
ExcludePaths:
- report2.xml
- report3.xml
SuccessCriteria:
PassRate: percent
LineCoverage: percent
BranchCoverage: percent
Vulnerabilities:
Severity: CRITICAL|HIGH|MEDIUM|LOW|INFORMATIONAL
Number: whole-number
Configuration
Steps:
- github-actions-code
action-name
(Required)
Specify the name of the action. All action names must be unique within the workflow. Action names are limited to alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_). Spaces are not allowed. You cannot use quotation marks to enable special characters and spaces in action names.
Corresponding UI: Configuration tab/action-name
Identifier
(action-name/Identifier)
Identifies the action. Do not change this property unless you want to change the version. For more information, see Specifying the action version to use.
Use aws/github-actions-runner@v1 for GitHub
Actions actions.
Corresponding UI: Workflow
diagram/action-name/aws/github-actions-runner@v1
label
DependsOn
(action-name/DependsOn)
(Optional)
Specify an action, action group, or gate that must run successfully in order for this action to run.
For more information about the 'depends on' functionality, see Sequencing actions.
Corresponding UI: Inputs tab/Depends on - optional
Compute
(action-name/Compute)
(Optional)
The computing engine used to run your workflow actions. You can specify compute either at the workflow level or at the action level, but not both. When specified at the workflow level, the compute configuration applies to all actions defined in the workflow. At the workflow level, you can also run multiple actions on the same instance. For more information, see Sharing compute across actions.
Corresponding UI: none
Fleet
(action-name/Compute/Fleet)
(Optional)
Specify the machine or fleet that will run your workflow or workflow actions. With on-demand fleets, when an action starts, the workflow provisions the resources it needs, and the machines are destroyed when the action finishes. Examples of on-demand fleets: Linux.x86-64.Large, Linux.x86-64.XLarge. For more information about on-demand fleets, see On-demand fleet properties.
With provisioned fleets, you configure a set of dedicated machines to run your workflow actions. These machines remain idle, ready to process actions immediately. For more information about provisioned fleets, see Provisioned fleet properties.
If Fleet is omitted, the default is Linux.x86-64.Large.
Corresponding UI: Configuration tab/Compute fleet - optional
Timeout
(action-name/Timeout)
(Optional)
Specify the amount of time in minutes (YAML editor), or hours and minutes (visual editor), that the action can run before CodeCatalyst ends the action. The minimum is 5 minutes and the maximum is described in Quotas for workflows in CodeCatalyst. The default timeout is the same as the maximum timeout.
Corresponding UI: Configuration tab/Timeout - optional
Environment
(action-name/Environment)
(Optional)
Specify the CodeCatalyst environment to use with the action. The action connects to the AWS account and optional Amazon VPC specified in the chosen environment. The action uses the default IAM role specified in the environment to connect to the AWS account, and uses the IAM role specified in the Amazon VPC connection to connect to the Amazon VPC.
Note
If the default IAM role does not have the permissions required by the action, you can configure the action to use a different role. For more information, see Changing the IAM role of an action.
For more information about environments, see Deploying into AWS accounts and VPCs and Creating an environment.
Corresponding UI: Configuration tab/Environment
Name
(action-name/Environment/Name)
(Required if Environment is included)
Specify the name of an existing environment that you want to associate with the action.
Corresponding UI: Configuration tab/Environment
Connections
(action-name/Environment/Connections)
(Optional)
Specify the account connection to associate with the action. You can specify a maximum of
one account connection under Environment.
If you do not specify an account connection:
-
The action uses the AWS account connection and default IAM role specified in the environment in the CodeCatalyst console. For information about adding an account connection and default IAM role to environment, see Creating an environment.
-
The default IAM role must include the policies and permissions required by the action. To determine what those policies and permissions are, see the description of the Role property in the action's YAML definition documentation.
For more information about account connections, see Allowing access to AWS resources with connected AWS accounts. For information about adding an account connection to an environment, see Creating an environment.
Corresponding UI: Configuration tab/Environment/What's in
my-environment?/three dot menu/Switch role
Name
(action-name/Environment/Connections/Name)
(Required if Connections is included)
Specify the name of the account connection.
Corresponding UI: Configuration tab/Environment/What's in
my-environment?/three dot menu/Switch role
Role
(action-name/Environment/Connections/Role)
(Required if Connections is included)
Specify the name of the IAM role that this action uses in order to access and operate in AWS services such as Amazon S3 and Amazon ECR. Make sure this role is added to your AWS account connection in your space. To add an IAM role to an account connection, see Adding IAM roles to account connections.
If you do not specify an IAM role, then the action uses the default IAM role listed in the environment in the CodeCatalyst console. If you use the default role in the environment, make sure it has the following policies.
Note
You can use the CodeCatalystWorkflowDevelopmentRole- role with this action.
For more information about this role, see Creating the CodeCatalystWorkflowDevelopmentRole-spaceName role for your account and space. Understand that the spaceNameCodeCatalystWorkflowDevelopmentRole- role has
full access permissions which may pose a security risk. We recommend that you only use this
role in tutorials and scenarios where security is less of a concern. spaceName
Warning
Limit the permissions to those required by the GitHub Action action. Using a role with broader permissions might pose a security risk.
Corresponding UI: Configuration tab/Environment/What's in
my-environment?/three dot menu/Switch role
Inputs
(action-name/Inputs)