跳到主要内容

Top-level Fields

This document defines the configuration specifications for top-level fields in plugin development, including plugin metadata, the declaration of input and output parameters, and the configuration of execution methods.

name

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

name: 'codecheck'

version

Required The version number of the plugin, using semantic versioning 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 function and purpose.

description: 'Sample plugin'

inputs

Required Input parameters. Input parameters can be used to specify the data used by the plugin 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 the _ character.

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 must be actively verified 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 within 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 an input parameter. Set it to true if the parameter is required.

inputs.<input_id>.default

Optional A string representing the default value. This value 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 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 within the outputs object, must start with a letter or _, and can only contain alphanumeric characters, -, or _.

outputs.<output_id>.description

Required Description of the output parameter.

runs

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

runs.using

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

Execution MethodDescription
node16Node.js version corresponding to the execution of 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'

The trigger mechanism for post:

Trigger MethodDescription
Manually stoppedThe user clicks to stop the pipeline, and the scheduler service actively calls it
Naturally calledAutomatically called after the plugin runs (the plugin developer must 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 SIGINT signal
process.on('SIGINT', () => {
// Call post logic
post();
process.exit(0);
});

// Plugin main logic...
}