跳到主要内容

Quick Start

You can quickly get started with the platform's pipeline features by reading this guide.

Prerequisites​

  • Apply for an internal testing slot for code-based pipelines (slots are limited; please contact AtomGit customer service for details)
  • Have an AtomGit account and create at least one repository
  • The repository must contain basic code content (at least one branch)
  • Familiarity with basic YAML syntax is required

Create the Workflow File​

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

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

Note: The directory for storing AtomGit Action workflow files is .gitcode/workflows/, not ./workflows/. An incorrect directory path will cause the pipeline to fail recognition and trigger.

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 Breakdown:

FieldDescription
nameWorkflow name, displayed in the pipeline list
onTriggering event, here set to push on the main branch
jobsCollection of jobs
runs-onRunner label, default uses the default resource pool
runExecutes shell commands

Common Context Variables in atomgit:

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

Trigger via Commit​

Committing the workflow file to the repository will trigger the pipeline:

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

Verify Successful Execution​

  1. Navigate to the AtomGit repository page and click the "Pipelines" or "Actions" tab
  2. Locate the "First Pipeline" entry in the pipeline list
  3. Click into the detail page to view the execution status
  4. Confirm that the Job status is ✅ (Success)