Skip to content

Commit

Permalink
add reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
User123698745 committed Oct 19, 2023
1 parent 0dc4908 commit 3f39c22
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 20 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: sync fork

on:
workflow_call:
inputs:
fork-name:
type: string
fork-branch:
required: true
type: string
upstream-name:
type: string
upstream-branch:
required: true
type: string
secrets:
fork-name:
type: string
upstream-name:
type: string
token:
required: true
type: string

jobs:
sync:
name: sync fork
runs-on: ubuntu-latest
steps:
- name: checkout fork
uses: actions/checkout@v4
with:
repository: ${{ secrets.fork-name || ${{ inputs.fork-name }} }}
ref: ${{ inputs.fork-branch }}
token: ${{ secrets.token }}
- name: sync with upstream
uses: aormsby/[email protected]
with:
upstream_sync_repo: ${{ secrets.upstream-name || ${{ inputs.upstream-name }} }}
upstream_sync_branch: ${{ inputs.upstream-branch }}
target_sync_branch: ${{ inputs.fork-branch }}
git_config_pull_rebase: true
target_branch_push_args: --force-with-lease
29 changes: 9 additions & 20 deletions .github/workflows/rss-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,12 @@ on:
- cron: 0 0 * * *

jobs:
sync:
name: sync fork
runs-on: ubuntu-latest

steps:
- name: checkout target
uses: actions/checkout@v3
with:
repository: User123698745/rss-bridge
ref: master
token: ${{ secrets.PAT }}

- name: sync with upstream
uses: aormsby/[email protected]
with:
upstream_sync_repo: RSS-Bridge/rss-bridge
upstream_sync_branch: master
target_sync_branch: master
git_config_pull_rebase: true
target_branch_push_args: --force-with-lease
master:
uses: ./.github/workflows/_sync.yml@main
with:
fork-name: User123698745/rss-bridge
fork-branch: master
upstream-name: RSS-Bridge/rss-bridge
upstream-branch: master
secrets:
token: ${{ secrets.PAT }}

0 comments on commit 3f39c22

Please sign in to comment.