forked from ipverse/asn-info
-
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
Showing
1 changed file
with
37 additions
and
31 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,37 +1,43 @@ | ||
on: | ||
schedule: | ||
- cron: '0 * * * *' | ||
name: Sync Upstream | ||
|
||
workflow_dispatch: # click the button | ||
env: | ||
# Required, URL to upstream (fork base) | ||
UPSTREAM_URL: "https://github.com/ipverse/asn-info.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 }} | ||
# Optional, defaults to main | ||
UPSTREAM_BRANCH: "master" | ||
# Optional, defaults to UPSTREAM_BRANCH | ||
DOWNSTREAM_BRANCH: "" | ||
# Optional fetch arguments | ||
FETCH_ARGS: "" | ||
# Optional merge arguments | ||
MERGE_ARGS: "" | ||
# Optional push arguments | ||
PUSH_ARGS: "" | ||
# 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: '1 18 * * *' | ||
# Allows manual workflow run (must in default branch to work) | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync_with_upstream: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Sync master with upstream latest | ||
|
||
steps: | ||
# Step 1: run a standard checkout action, provided by github | ||
- name: Checkout master | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
|
||
# Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch | ||
- name: Pull (Fast-Forward) upstream changes | ||
id: sync | ||
uses: aormsby/[email protected] | ||
with: | ||
upstream_repository: ipverse/asn-info | ||
upstream_branch: master | ||
target_branch: master | ||
git_pull_args: --merge | ||
|
||
# Step 3: Display a message if 'sync' step had new commits (simple test) | ||
- name: Check for new commits | ||
if: steps.sync.outputs.has_new_commits | ||
run: echo "There were new commits." | ||
|
||
# Step 4: Print a helpful timestamp for your records (not required, just nice) | ||
- name: Timestamp | ||
run: date | ||
- 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 }} |