Skip to content

Commit

Permalink
fix: triggering gitlab pipeline on tags (#717)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ntn-x2 authored Sep 4, 2024
1 parent d8b12ef commit fc02757
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/trigger-gitlab-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ jobs:
with:
fetch-depth: 0

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

- name: Trigger GitLab CI
run: |
Expand Down

0 comments on commit fc02757

Please sign in to comment.