Referencing files in an artifact
If you have a file that resides within an artifact, and you need to refer to this file in one of your Amazon CodeCatalyst workflow actions, complete the following procedure.
Note
See also Referencing source repository files.
- Visual
-
Not available. Choose YAML to view the YAML instructions.
- YAML
-
To reference files in an artifact (YAML editor)
Open the CodeCatalyst console at https://codecatalyst.aws/
. -
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.
-
Choose Edit.
-
Choose YAML.
-
In the action where you want to reference a file, add code similar to the following:
Actions: My-action: Inputs: Sources: - WorkflowSource Artifacts: -
artifact-name
Configuration: template:artifact-path
/path/to/file.ymlIn the previous code, replace:
-
artifact-name
with the name of the artifact. -
artifact-path
with a value from the following table.
If you're adding the reference to... Replace artifact-path
with...$CATALYST_SOURCE_DIR_
artifact-name
/All other actions
$CATALYST_SOURCE_DIR_
artifact-name
/or
/artifacts/
current-action-name
/artifact-name
/or
If the current action is within an action group:
/artifacts/
current-action-group@current-action-name
/artifact-name
/For examples, see Examples of artifacts.
Note
You can omit the
artifact-path
and just specify the file path relative to the artifact root directory if:-
The action where you're including the reference only includes one item under
Inputs
(for example, it includes one input artifact and no source). -
The file that you want to reference resides in the primary input. The primary input is either the
WorkflowSource
, or the first input artifact listed, if there is noWorkflowSource
.
-
-
(Optional) Choose Validate to validate the workflow's YAML code before committing.
-
Choose Commit, enter a commit message, and choose Commit again.