Sync Repo with Upstream and release to staging #36
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
name: Sync Repo with Upstream and release to staging | |
on: | |
schedule: | |
- cron: '35 6 * * *' | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
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 repository | |
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 into staging excluding Dockerfile | |
run: | | |
git merge upstream/master --no-commit --no-ff --allow-unrelated-histories || true | |
git reset HEAD Dockerfile .github/workflows/* | |
git checkout -- Dockerfile .github/workflows/* | |
git add -A | |
git commit -m "Merge upstream changes into staging" | |
git push origin staging |