forked from jhaals/yopass
-
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.
add a github action to sync upstream branch to staging
- Loading branch information
Showing
1 changed file
with
40 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,40 @@ | ||
name: Sync Upstream to Staging | ||
|
||
on: | ||
Check warning on line 3 in .github/workflows/sync-repo-with-upstream.yml GitHub Actions / Yamllint
|
||
schedule: | ||
- cron: '35 12 * * *' # Testing during daytime for now | ||
Check failure on line 5 in .github/workflows/sync-repo-with-upstream.yml GitHub Actions / Yamllint
|
||
workflow_dispatch: # Allows manual triggering | ||
Check warning on line 6 in .github/workflows/sync-repo-with-upstream.yml GitHub Actions / Yamllint
|
||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
Check warning on line 13 in .github/workflows/sync-repo-with-upstream.yml GitHub Actions / Yamllint
|
||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
- name: Add upstream remote | ||
run: git remote add upstream https://github.com/jhaals/yopass.git | ||
|
||
- name: Fetch upstream changes | ||
run: git fetch upstream | ||
|
||
- name: Checkout staging branch | ||
run: git checkout staging | ||
|
||
- name: Merge upstream changes excluding Dockerfile | ||
run: | | ||
git merge upstream/master --no-commit --no-ff | ||
git reset HEAD Dockerfile | ||
git checkout -- Dockerfile | ||
git commit -m "Merge upstream changes excluding Dockerfile" # we have custom changes in Dockerfile we need to retain | ||
- name: Push changes to the staging branch | ||
run: git push origin staging |