mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
45 lines
1.5 KiB
YAML
45 lines
1.5 KiB
YAML
name: Sync Repositories
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- preview
|
|
|
|
env:
|
|
SOURCE_BRANCH_NAME: ${{ github.ref_name }}
|
|
|
|
jobs:
|
|
sync_changes:
|
|
runs-on: ubuntu-20.04
|
|
permissions:
|
|
pull-requests: write
|
|
contents: read
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
|
|
- name: Setup GH CLI
|
|
run: |
|
|
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
|
|
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
|
|
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
|
sudo apt update
|
|
sudo apt install gh -y
|
|
|
|
- name: Push Changes to Target Repo
|
|
env:
|
|
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
|
run: |
|
|
TARGET_REPO="${{ vars.SYNC_TARGET_REPO }}"
|
|
TARGET_BRANCH="${{ vars.SYNC_TARGET_BRANCH_NAME }}"
|
|
SOURCE_BRANCH="${{ env.SOURCE_BRANCH_NAME }}"
|
|
|
|
git checkout $SOURCE_BRANCH
|
|
git remote add target-origin-a "https://$GH_TOKEN@github.com/$TARGET_REPO.git"
|
|
git push target-origin-a $SOURCE_BRANCH:$TARGET_BRANCH
|