GitHub Action for trigger gitlab-ci jobs.
Trigger New GitLab CI Job.
action "Trigger New Job" {
uses = "appleboy/gitlab-ci-action@master"
secrets = [
"GITLBA_PROJECT_ID",
"GITLBA_TOKEN",
]
}
See the detail documentation for Triggering pipelines through the API. How to get the token from a new trigger? You can add a new trigger by going to your project’s Settings ➔ CI/CD
under Triggers.
How to get the project ID? going to your project’s Settings ➔ General
under Gerneral project.
Specific the GitLab host URL:
action "Trigger New Job" {
uses = "appleboy/gitlab-ci-action@master"
env = {
GITLBA_HOST = "https://example.com"
DEBUG = "true"
}
secrets = [
"GITLBA_PROJECT_ID",
"GITLBA_TOKEN",
]
}
Other specific branch
or tag
name:
action "Trigger New Job" {
uses = "appleboy/gitlab-ci-action@master"
env = {
DEBUG = "true"
GITLBA_REF = "v1.1.1"
}
secrets = [
"GITLBA_PROJECT_ID",
"GITLBA_TOKEN",
]
}
- GITLBA_HOST - Optional. gitlab-ci base url, default as
https://gitlab.com
- GITLBA_REF - Optional. Triggers can be used to force a pipeline rerun of a specific ref (
branch
ortag
) with an API call. Default asmaster
. - DEBUG - Optional. show the debug message.
- GITLBA_TOKEN - Required. A unique trigger token can be obtained when adding a new trigger.
- GITLBA_PROJECT_ID - Required. project id.