跳到主要内容

Workflow Commands

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

5.1 Setting Step Output - ATOMGIT_OUTPUT

Write values to the step output, which can be accessed by subsequent steps through 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

Write values to environment variables for subsequent steps, available in subsequent steps of the current Job.

echo "MY_VAR=my_value" >> $ATOMGIT_ENV

Multi-line environment variables:

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

5.3 Setting System PATH - ATOMGIT_PATH

Add 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

Write 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 should no longer be used:

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