-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37230d0
commit b4377e3
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: rustdesk | ||
on: | ||
schedule: | ||
- cron: '57 12 * * *' | ||
workflow_dispatch: | ||
repository_dispatch: | ||
types: sync-rustdesk | ||
jobs: | ||
repo-sync: | ||
env: | ||
PAT: ${{ secrets.PAT }} | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.owner.id == github.event.sender.id | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Check if branch exists | ||
id: check_branch | ||
run: | | ||
if git show-ref --verify --quiet refs/heads/rustdesk; then | ||
echo "branch_exists=true" >> $GITHUB_ENV | ||
else: | ||
echo "branch_exists=false" >> $GITHUB_ENV | ||
fi | ||
- name: Delete existing branch | ||
if: ${{ env.branch_exists == 'true' }} | ||
run: | | ||
git push origin --delete rustdesk | ||
- name: Create new branch | ||
if: ${{ env.branch_exists == 'false' }} | ||
run: | | ||
git checkout -b rustdesk | ||
git push --set-upstream origin rustdesk | ||
- name: Sync branch | ||
uses: repo-sync/github-sync@v2 | ||
if: env.PAT | ||
with: | ||
source_repo: "https://github.com/rustdesk/rustdesk" | ||
source_branch: "master" | ||
destination_branch: "rustdesk" | ||
github_token: ${{ secrets.PAT }} |