Skip to content

Merge pull request #17 from RIKEN-RCCS/feature/ci #465

Merge pull request #17 from RIKEN-RCCS/feature/ci

Merge pull request #17 from RIKEN-RCCS/feature/ci #465

name: Sync protected branches to GitLab
on:
push:
branches:
- develop
- main
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Push protected branches and tags to GitLab
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITLAB_REPO: ${{ secrets.GITLAB_REPO }}
run: |
set -euo pipefail
git config user.name "github-bot"
git config user.email "bot@example.com"
git remote add gitlab https://oauth2:${GITLAB_TOKEN}@${GITLAB_REPO}
git fetch origin +refs/heads/develop:refs/remotes/origin/develop +refs/heads/main:refs/remotes/origin/main
git push -o ci.skip gitlab refs/remotes/origin/develop:refs/heads/develop refs/remotes/origin/main:refs/heads/main --force
git push -o ci.skip gitlab --tags --force