跳到主要内容

action.yml Metadata Syntax

This document introduces the complete syntax of the plugin metadata file action.yml, including file format specifications, naming conventions, version number specifications, and a complete example.

action.yml is the core configuration file for the plugin, containing metadata, inputs and outputs, runtime environment, and other information about the plugin. It is used to identify and load the plugin using action.yml.

Complete Example

# action.yml
name: 'action-demo'
version: '1.0.0'
author: 'XXX'
description: 'Sample Plugin'
inputs:
key_input:
description: 'Single line input test'
required: true
default: test

outputs:
record_id:
description: "Record ID"
report_url:
description: "Report link"
runs:
using: 'node16'
main: 'dist/main.js'
post: 'dist/stop.js'

Define File Format Specifications

RuleDescription
FormatMandatory YAML format
FilenameMandatory Must be named action.yml, case-sensitive

Version Number Specifications

The version number uses semantic versioning format X.Y.Z (e.g., 1.0.0):

Version SegmentMeaningIncrement ConditionsExample
X (Major Version)Major feature changes, incompatible API changesIncompatible major changes1.0.02.0.0
Y (Minor Version)New features added with backward compatibilityBackward compatible new features1.0.01.1.0
Z (Patch Version)Backward compatible bug fixesBackward compatible bug fixes1.0.01.0.1

Note

  • The version number can only be incremented, not rolled back
  • The version number must not contain letters or special characters, only numbers and dots
  • Pre-release version identifiers can be used: 1.0.0-alpha, 1.0.0-beta, 1.0.0-rc, etc.