Skip to content

Commit

Permalink
#305 sync script update
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Jul 21, 2024
1 parent 83c8ab9 commit 6409529
Showing 1 changed file with 43 additions and 5 deletions.
48 changes: 43 additions & 5 deletions .github/workflows/gitlab_sync_pr_issues.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
name: Sync PRs and Issues to GitLab

on:
push:
branches:
- '*'
pull_request:
schedule:
- cron: '0 * * * *' # Runs every hour
workflow_dispatch:

jobs:
sync:
Sync:
runs-on: ubuntu-latest

env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
GITLAB_REPO_1: 'SaintAngeLs/distributed_minispace'
GITLAB_REPO_2: 'distributed-asp-net-core-blazor-social-app/distributed_minispace'
steps:
- name: Checkout repository
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0 # Fetch all branches

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -23,12 +35,38 @@ jobs:
python -m pip install --upgrade pip
pip install requests
- name: Configuring git
run: |
git config --global user.email "voznesenskijandrej5@gmail.com"
git config --global user.name "Andrii Voznesenskyi"
- name: Remove .gitlab-ci.yml for specific repository
run: |
if [[ "${{ github.repository }}" == "SaintAngeLs/distributed_minispace" ]]; then
rm -f .gitlab-ci.yml
fi
- name: Adding GitLab remote repository 1
run: |
GITLAB_REPO="https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/SaintAngeLs/distributed_minispace.git"
git remote add gitlab1 $GITLAB_REPO || git remote set-url gitlab1 $GITLAB_REPO
- name: Adding GitLab remote repository 2
run: |
GITLAB_REPO="https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/distributed-asp-net-core-blazor-social-app/distributed_minispace.git"
git remote add gitlab2 $GITLAB_REPO || git remote set-url gitlab2 $GITLAB_REPO
- name: Push all branches and tags to both GitLab repositories
run: |
git push gitlab1 --all --tags --force
git push gitlab2 --all --tags --force
- name: Sync Pull Requests and Issues to GitLab
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
GITLAB_REPO_1: 'SaintAngeLs/distributed_minispace'
GITLAB_REPO_2: 'distributed-asp-net-core-blazor-social-app/distributed-asp-net-core-blazor-social-application/distributed-minispace'
GITLAB_REPO_2: 'distributed-asp-net-core-blazor-social-app/distributed_minispace'
run: |
python sync_prs_issues.py
python .github/workflows/sync_prs_issues.py

0 comments on commit 6409529

Please sign in to comment.