跳到主要内容

Quick Start

You can quickly start using the pipeline feature on the platform by reading this document.

Prerequisites

  • Have an AtomGit/GitCode account and create at least one repository
  • The repository has basic code content (at least one branch)
  • Have basic knowledge of YAML syntax

Create a Workflow File

Create a .gitcode/workflows/ directory in the root of the repository and add a YAML file:

mkdir -p .gitcode/workflows
touch .gitcode/workflows/first-pipeline.yml

Note: The workflow file for AtomGit Action is stored in .gitcode/workflows/, not ./workflows/. An incorrect directory path will cause the pipeline to be unrecognized and not triggered.

Minimal YAML Example

name: First Pipeline

on:
push:
branches:
- main

jobs:
hello:
runs-on: ubuntu-latest
steps:
- name: Print hello message
run: echo "Hello GitCode Action"

Example Explanation:

FieldDescription
nameWorkflow name, displayed in the pipeline list
onTrigger event, here it's a push event on the main branch
jobsCollection of jobs
runs-onRunner label, default uses the default resource pool
runExecute shell command

Commonly Used Variables in AtomGit Context:

VariableDescription
ATOMGIT_REFTriggered branch or tag reference (e.g., refs/heads/main)
ATOMGIT_SHASHA value of the triggered commit
ATOMGIT_REPOSITORYFull name of the repository (e.g., owner/repo)
ATOMGIT_EVENT_NAMEType of trigger event (e.g., push, pull_request)
ATOMGIT_WORKFLOWCurrent workflow name

Submit to Trigger

Submit the workflow file to the repository to trigger the pipeline:

git add .gitcode/workflows/first-pipeline.yml
git commit -m "Add first GitCode Action pipeline"
git push origin main

Verify Success Result

  1. Go to the AtomGit repository page and click on "Pipeline" or "Actions" Tab
  2. Find the "First Pipeline" entry in the pipeline list
  3. Click to enter the details page and check the execution status
  4. Confirm that the Job status is ✅ (Success)