跳到主要内容

Quick Start

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

Prerequisites

  • Contact AtomGit customer service to apply for the code pipeline capability
  • Have an AtomGit account and create at least one repository
  • The repository already has basic code content (at least one branch)
  • Have a basic understanding of YAML syntax

Create Workflow File

Create a .gitcode/workflows/ directory at 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 the directory .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:
name: Welcome
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 is push event on the main branch
jobsCollection of jobs
runs-onRunner tag, 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 Successful Results

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