forked from prebid/Prebid.js
-
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
64 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,64 @@ | ||
name: Sync Upstream | ||
|
||
env: | ||
# Required, URL to upstream (fork base) | ||
UPSTREAM_URL: "https://github.com/prebid/Prebid.js.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.GITHUB_TOKEN }} | ||
# Optional, defaults to main | ||
UPSTREAM_BRANCH: "master" | ||
# Optional, defaults to UPSTREAM_BRANCH | ||
DOWNSTREAM_BRANCH: "master" | ||
# 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: | ||
push: | ||
branches: | ||
- DO_NOT_MERGE_aja_staging | ||
schedule: | ||
- cron: '1 18 * * *' | ||
# Allows manual workflow run (must in default branch to work) | ||
workflow_dispatch: | ||
|
||
jobs: | ||
fetch-upstream: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Sync master | ||
uses: dabreadman/sync-upstream-repo@v1.3.0 | ||
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: Rebase DO_NOT_MERGE_aja_staging | ||
run: | | ||
git clone https://github.com/ajainc/Prebid.js.git work | ||
cd work | ||
git config user.name ajarobot | ||
git config user.email ajarobot@users.noreply.github.com | ||
git config --local user.password ${{ secrets.GITHUB_TOKEN }} | ||
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/ajainc/Prebid.js.git" | ||
git remote add upstream https://github.com/prebid/Prebid.js.git | ||
git fetch upstream | ||
git remote -v | ||
git switch DO_NOT_MERGE_aja_staging | ||
git push origin | ||
git rebase origin/master | ||
git push -f origin DO_NOT_MERGE_aja_staging | ||
cd .. | ||
rm -rf work |