跳到主要内容

Top-level Fields

This document introduces the complete definitions of top-level fields in action.yml, including the configuration rules for name, version, author, description, inputs, outputs, and runs.

name​

Required The name of the plugin. AtomGit Pipeline displays name in the pipeline orchestration interface, helping users intuitively identify each plugin in the steps.

name: 'codecheck'

version​

Required The version number of the plugin, in semantic version format X.Y.Z.

version: '1.0.0'

author​

Required The identifier of the plugin author, such as an employee ID.

author: 'XXX'

description​

Required A one-sentence description of the plugin's functionality.

description: 'Sample plugin'

inputs​

Required Input parameters. Input parameters can be used to specify data that the plugin uses at runtime. AtomGit Pipeline stores input parameters as environment variables. It is recommended to use lowercase input IDs.

When specifying inputs, the system creates an environment variable named INPUT_<VARIABLE_NAME>. The input name will be converted to uppercase and spaces will be replaced with _ characters.

inputs:
key_input:
description: 'Single-line input test'
required: true
default: test

Note If no input is specified, an operation with required: true will not automatically return an error; it needs to be validated explicitly in the code.

inputs.<input_id>​

Required A string identifier associated with the input. The value of <input_id> is a mapping of input metadata. <input_id> must be a unique identifier in the inputs object, must start with a letter or _, and can only contain alphanumeric characters, -, or _.

inputs.<input_id>.description​

Required A string description of the input parameter.

inputs.<input_id>.required​

Optional A boolean indicating whether the operation requires the input parameter. Set it to true if the parameter is needed.

inputs.<input_id>.default​

Optional A string representing the default value. This is used when the input parameter is not specified in the pipeline orchestration file.

outputs​

Required Output parameters. Output parameters can be used to declare data set by the plugin, and subsequent operations in the workflow can use the output data from previous operations.

outputs:
record_id:
description: "recordId"

outputs.<output_id>​

Required A string identifier associated with the output. <output_id> must be a unique identifier in the outputs object, must start with a letter or _, and can only contain alphanumeric characters, -, or _.

outputs.<output_id>.description​

Required A description of the output parameter.

runs​

Required Specifies the execution method and runtime of the current Action.

runs.using​

Required The execution method of the Action. The following three options are supported:

Execution MethodDescription
node16Node.js version, executes JavaScript/TypeScript compiled code

runs.main​

Required The JavaScript code entry file corresponding to the Action execution.

runs:
using: 'node16'
main: 'dist/main.js'

runs.post​

Optional The JavaScript code entry file corresponding to the termination of the Action, used for cleaning up, executing post-processing logic, etc.

runs:
using: 'node16'
main: 'dist/main.js'
post: 'dist/stop.js'

Trigger mechanism for post:

Trigger MethodDescription
Manual StopUser clicks to stop the pipeline, called actively by the scheduling service
Natural CallAutomatically called after the plugin runs (the plugin developer needs to actively listen for termination signals in main and call the post logic)

Example - Listening for termination signals in main:

// Import the relevant post method
import {post} from "./stop";

async function run() {
// Capture the SIGINT signal
process.on('SIGINT', () => {
// Call the post logic
post();
process.exit(0);
});

// Plugin main logic...
}