Skip to content

Commit fc02757

Browse files
authored
fix: triggering gitlab pipeline on tags (#717)
I noticed that if we trigger Gitlab pipeline from a tag, the action fails. And if we trigger it from a branch, the Docker image tags are weird. So we should trigger it from a tag from the release branch and from branch (push) from develop and master.
1 parent d8b12ef commit fc02757

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/trigger-gitlab-pipeline.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ jobs:
2323
with:
2424
fetch-depth: 0
2525

26-
- name: Sync HEAD with GitLab
27-
uses: saderi/push-to-gitlab@v1
28-
with:
29-
gitlab_repository: 'gitlab.com/kiltprotocol/kilt-node'
30-
gitlab_token: ${{ secrets.KILTBOT_PUSH_ACCESS_TOKEN }}
26+
- name: Config Gitlab env
27+
run: |
28+
git config --global user.name "github-actions[bot]"
29+
git remote add gitlab https://oauth2:${{ secrets.KILTBOT_PUSH_ACCESS_TOKEN }}@gitlab.com/kiltprotocol/kilt-node
30+
31+
- name: Push latest ref (branch or tag)
32+
run: git push gitlab ${{ github.ref_name }}
33+
# It can happen that the Gitlab mirror is updated in the meanwhile, and the ref already exists there, so we ignore the error.
34+
continue-on-error: true
3135

3236
- name: Trigger GitLab CI
3337
run: |

0 commit comments

Comments
 (0)