From 839b8f7b49b55274a90688dd9f2a60c8e5b924b5 Mon Sep 17 00:00:00 2001 From: minsuKang <90169703+minchodang@users.noreply.github.com> Date: Tue, 6 Aug 2024 21:21:05 +0900 Subject: [PATCH] Feat: sync-upstream (#30) --- .github/workflows/sync-upstream.yml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/sync-upstream.yml diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml new file mode 100644 index 0000000..224b774 --- /dev/null +++ b/.github/workflows/sync-upstream.yml @@ -0,0 +1,44 @@ +name: Sync Upstream + +on: + schedule: + - cron: '0 * * * *' # 매 시간마다 체크 + push: + branches: + - main + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout Upstream + uses: actions/checkout@v2 + with: + repository: meta-test-be + token: ${{ secrets.GITHUB_TOKEN }} + path: upstream + + - name: Checkout Fork + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + path: fork + + - name: Sync Upstream to Fork + run: | + cd fork + git remote add upstream ../upstream + git fetch upstream + git checkout main + git merge upstream/main --no-commit --no-ff + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: 'Sync with upstream' + branch: sync-upstream + base: main + title: 'Sync with upstream' + body: 'This PR syncs the fork with upstream repository'