Manually Triggering a Pipeline
This document introduces how to manually trigger a workflow through the workflow_dispatch event on the AtomGit interface and pass input parameters.
When you need to actively execute a pipeline in non-automatic scenarios — for example, debugging a branch, verifying temporary parameters, or releasing a specific version — you can manually trigger it using the workflow_dispatch event.
Configuration Instructions
Define a workflow_dispatch workflow
Create or edit a workflow file in the .gitcode/workflows/ directory and add the workflow_dispatch trigger event:
# .gitcode/workflows/manual-deploy.yml
name: Manual Deploy
on:
workflow_dispatch:
inputs:
environment:
description: 'Deployment target environment'
required: true
default: 'staging'
type: string
version:
description: 'Deployment version number'
required: true
type: string
dry-run:
description: 'Simulate only, do not actually deploy'
required: false
type: string
default: "false"
tags:
description: 'Test tags (comma separated)'
required: false
type: string
stages:
validate:
name: Validation
jobs:
Check:
name: check-version
runs-on: [ubuntu-24, x64, small]
steps:
- name: Run deploy
run: echo "Deploy version ${{ inputs.version }} to ${{ inputs.environment }}"
- name: Run dry
run: echo "Dry run mode = ${{ inputs.dry-run }}"
deploy:
name: Deployment
jobs:
Deploy:
name: push-to-env
runs-on: [ubuntu-24, x64, medium]
steps:
- name: Run deploy
run: make deploy ENV=${{ inputs.environment }} VERSION=${{ inputs.version }}
Detailed Explanation of Inputs Field Types
The inputs of AtomGit Action supports string, enum, and increment types. All input values are strings.
| type | Description | Example |
|---|---|---|
string | Text input | Version number, image name, environment name |
enum | Option input | Environment name |
increment | Increment | Version number |
Each input field property:
description: Description text for the input item, displayed in the trigger formrequired: Whether it is required (true/false)default: Default valuetype: Input type, currently onlystringis supported
Trigger Operation
- Go to the Actions tab of the project.
- Select the target workflow name on the left.
- Click the Run workflow button on the right.
- A form pops up, select or enter each
inputsparameter, and choose the target branch. - Click Run to submit the trigger.
Note: Only workflows with
workflow_dispatchin theonfield will display the Run workflow button.
Referencing inputs within a workflow
steps:
- run: echo "Environment = ${{ inputs.environment }}"
- run: echo "Version = ${{ inputs.version }}"
- if: ${{ inputs.dry-run == 'true' }}
run: echo "This is a dry run"
The inputs context is only available in runs triggered by workflow_dispatch, referencing inputs in other triggering events will result in an error.
Frequently Asked Questions
Q: After clicking Run workflow, it prompts "This workflow does not support manual triggering"?
A: The on field of the workflow does not include the workflow_dispatch event. Please modify the .gitcode/workflows/{file}.yml file and add this trigger type.
Q: Can workflow_dispatch coexist with other triggering events?
A: Yes. The on field supports multiple events:
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
environment:
type: string
Q: How to specify a branch when triggering manually?
A: There is a branch selection dropdown in the trigger form. By default, it is set to the repository's default branch, but you can switch to any branch. The workflow will execute using the version of the .gitcode/workflows/ file on that branch.