This repository was archived by the owner on Apr 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change
1
+ .idea /
2
+ * .iml
3
+ .DS_Store
Original file line number Diff line number Diff line change
1
+ ## Gitlab Trigger Action
2
+
3
+ ### Inputs
4
+ endpoint - (Optional) Endpoint to Gitlab. e.g. https://gitlab.example.com . Leave blanc for default <br >
5
+ token - Your Gitlab token. Make sure token has rights to launch pipelines <br >
6
+ projectId - ProjectId of your pipeline repo <br >
7
+ envs - (Optional) Environment variables you want to pass to Gitlab <br >
8
+ ref - (Optional) Git branch of target pipeline repo
9
+
10
+ ## Example
11
+ ``` yaml
12
+ name : Build
13
+
14
+ on :
15
+ push :
16
+ branches :
17
+ - ' *'
18
+
19
+ jobs :
20
+ build :
21
+ runs-on : ubuntu-latest
22
+ steps :
23
+ - uses : qameta/gitlab-trigger@master
24
+ with :
25
+ token : ${{ secrets.GITLAB_TOKEN }}
26
+ projectId : " 154854"
27
+ envs : VERSION=${{ steps.version.outputs.name }},ARCH=amd64
28
+ ` ` `
Original file line number Diff line number Diff line change
1
+ name : " Gitlab Trigger Action"
2
+ description : " Triggers Gitlab pipeline with envs"
3
+ inputs :
4
+ token :
5
+ description : " Gitlab token"
6
+ required : true
7
+ projectId :
8
+ description : " Project ID where your Gitlab CI Pipeline awaits"
9
+ required : true
10
+ endpoint :
11
+ description : " Gitlab endpoint (defaults to Official Gitlab Endpoint)"
12
+ default : " https://gitlab.com"
13
+ required : false
14
+ ref :
15
+ description : " Git branch of target pipeline"
16
+ default : " master"
17
+ required : false
18
+ envs :
19
+ description : " Environment variables separated with , without spaces (e.g. VERSION=1.1.2,ARCH=amd64)"
20
+ required : false
21
+ runs :
22
+ using : composite
23
+ steps :
24
+ - name : Download gl cli util
25
+ shell : bash
26
+ run : |
27
+ echo "Downloading and installing dependencies"
28
+ curl https://dl.qameta.io/artifactory/bin/gitlab/gl -o gl && \
29
+ chmod +x gl && \
30
+ mv gl /usr/local/bin
31
+ - name : Authorizing in Gitlab
32
+ shell : bash
33
+ run : gl auth login --token=${{ inputs.token }} --project-id=${{ inputs.projectId }} --endpoint=${{ inputs.endpoint }}
34
+ - name : Triggering Gitlab Pipeline
35
+ shell : bash
36
+ run : gl pipeline run --ref=${{ inputs.ref }} --env=${{ inputs.envs }}
You can’t perform that action at this time.
0 commit comments