Quick Start
Prerequisites
- Have an AtomGit/GitCode account and created at least one repository
- The repository has basic code content (at least one branch)
- 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 should be placed in
.gitcode/workflows/, not./workflows/. An incorrect directory path will cause the pipeline to not be recognized or 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:
| Field | Description |
|---|---|
name | Workflow name, displayed in the pipeline list |
on | Trigger event, here it is the push event on the main branch |
jobs | Collection of jobs |
runs-on | Runner tag, default uses the default resource pool |
run | Execute shell command |
Commonly Used Variables in AtomGit Context:
| Variable | Description |
|---|---|
ATOMGIT_REF | Triggered branch or tag reference (e.g., refs/heads/main) |
ATOMGIT_SHA | SHA value of the triggered commit |
ATOMGIT_REPOSITORY | Full name of the repository (e.g., owner/repo) |
ATOMGIT_EVENT_NAME | Type of trigger event (e.g., push, pull_request) |
ATOMGIT_WORKFLOW | Current 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
- Go to the AtomGit repository page and click on "Pipeline" or "Actions" tab
- Find the "First Pipeline" entry in the pipeline list
- Click to enter the details page and check the execution status
- Confirm that the Job status is ✅ (Success)