github: mirror pull requests #803
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mirror and run GitLab CI | |
on: | |
push: | |
pull_request: | |
types: [opened, reopened] | |
jobs: | |
to_gitlab: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Redefine branch on pull_request | |
if: github.event_name == 'pull_request' | |
run: | | |
echo "current_branch=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV | |
- name: Mirror + trigger CI | |
uses: SvanBoxel/gitlab-mirror-and-ci-action@0.6 | |
with: | |
args: "https://gitlab.desy.de/dcache/dcache" | |
env: | |
FOLLOW_TAGS: "true" | |
FORCE_PUSH: "false" | |
GITLAB_HOSTNAME: "gitlab.desy.de" | |
GITLAB_USERNAME: "dcache" | |
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} | |
GITLAB_PROJECT_ID: "21" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
POLL_TIMEOUT: 60 | |
CHECKOUT_BRANCH: ${{ env.current_branch }} # New non-GITHUB variable to make push and PR work |