跳到主要内容

Workflow Commands

This document is the complete reference for AtomGit Action workflow commands, covering the usage of commands such as ATOMGIT_OUTPUT, ATOMGIT_ENV, ATOMGIT_PATH, and ATOMGIT_STEP_SUMMARY.

Workflow commands are a mechanism to send special instructions to the Runner via echo, used to set outputs, environment variables, PATH, and more.

5.1 Setting Step Output - ATOMGIT_OUTPUT

Writes a value to the step output, which can be accessed by subsequent steps via steps.<step_id>.outputs.<name>.

echo "result=success" >> $ATOMGIT_OUTPUT

Multi-line Output:

echo "multiline<<EOF" >> $ATOMGIT_OUTPUT
echo "First line content"
echo "Second line content"
echo "EOF" >> $ATOMGIT_OUTPUT

5.2 Setting Environment Variables - ATOMGIT_ENV

Writes a value to the environment variable for subsequent steps, available in the current Job's subsequent steps.

echo "MY_VAR=my_value" >> $ATOMGIT_ENV

Multi-line Environment Variable:

echo "MULTILINE<<EOF" >> $ATOMGIT_ENV
echo "First line"
echo "Second line"
echo "EOF" >> $ATOMGIT_ENV

5.3 Setting System PATH - ATOMGIT_PATH

Adds a directory to the Runner's PATH, effective in subsequent steps of the current Job.

echo "/custom/bin" >> $ATOMGIT_PATH

5.4 Step Summary - ATOMGIT_STEP_SUMMARY

Writes Markdown content to the workflow run summary, displayed on the AtomGit workflow run details page.

echo "## Build Result" >> $ATOMGIT_STEP_SUMMARY
echo "| Project | Status |" >> $ATOMGIT_STEP_SUMMARY
echo "|--------|--------|" >> $ATOMGIT_STEP_SUMMARY
echo "| App | ✅ Success |" >> $ATOMGIT_STEP_SUMMARY

5.6 Deprecated Command Format

The following old command format is deprecated and is no longer recommended for use:

Deprecated CommandAlternative
echo "::set-output name=result::success"echo "result=success" >> $ATOMGIT_OUTPUT
echo "::set-env name=MY_VAR::my_value"echo "MY_VAR=my_value" >> $ATOMGIT_ENV
echo "::add-path::/custom/bin"echo "/custom/bin" >> $ATOMGIT_PATH