-
Notifications
You must be signed in to change notification settings - Fork 46
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
ea34503
commit f2a8f9e
Showing
1 changed file
with
20 additions
and
36 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 |
---|---|---|
@@ -1,44 +1,28 @@ | ||
name: Sync Upstream | ||
name: Sync Fork | ||
|
||
env: | ||
# Required, URL to upstream (fork base) | ||
UPSTREAM_URL: "https://github.com/SamR1/FitTrackee.git" | ||
# Required, token to authenticate bot, could use ${{ secrets.GITHUB_TOKEN }} | ||
# Over here, we use a PAT instead to authenticate workflow file changes. | ||
#WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | ||
WORKFLOW_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Optional, defaults to master | ||
UPSTREAM_BRANCH: "master" | ||
# Optional, defaults to UPSTREAM_BRANCH | ||
DOWNSTREAM_BRANCH: "" | ||
# Optional fetch arguments | ||
FETCH_ARGS: "--tags" | ||
# Optional merge arguments | ||
MERGE_ARGS: "" | ||
# Optional push arguments | ||
PUSH_ARGS: "--tags --force" | ||
# Optional toggle to spawn time logs (keeps action active) | ||
SPAWN_LOGS: "false" # "true" or "false" | ||
|
||
# This runs every day on 1801 UTC | ||
on: | ||
schedule: | ||
- cron: '0 22 * * *' | ||
# Allows manual workflow run (must in default branch to work) | ||
- cron: '0 0 * * *' # This will run the action daily at midnight | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: GitHub Sync to Upstream Repository | ||
uses: dabreadman/[email protected] | ||
with: | ||
upstream_repo: ${{ env.UPSTREAM_URL }} | ||
upstream_branch: ${{ env.UPSTREAM_BRANCH }} | ||
downstream_branch: ${{ env.DOWNSTREAM_BRANCH }} | ||
token: ${{ env.WORKFLOW_TOKEN }} | ||
fetch_args: ${{ env.FETCH_ARGS }} | ||
merge_args: ${{ env.MERGE_ARGS }} | ||
push_args: ${{ env.PUSH_ARGS }} | ||
spawn_logs: ${{ env.SPAWN_LOGS }} | ||
- name: Checkout using TOKEN | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "DavidHenryThoreau" | ||
git config user.email "[email protected]" | ||
- name: Sync with Upstream using UPSTREAM_PAT | ||
run: | | ||
git remote add upstream https://x-access-token:${{ secrets.UPSTREAM_PAT }}@github.com/SamR1/FitTrackee.git | ||
git fetch upstream | ||
git merge upstream/master --allow-unrelated-histories # To deal with divergent histories | ||
git push origin master |