Skip to content

Commit

Permalink
github: mirror pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Oct 9, 2024
1 parent f945c3d commit cd9c90d
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@ jobs:
to_gitlab:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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
- 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

0 comments on commit cd9c90d

Please sign in to comment.