Sync Quarkus Upstream Repository #21
This file contains hidden or 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 Quarkus Upstream Repository | |
on: | |
schedule: | |
- cron: '0 3 * * *' # Runs hourly at minute 45 | |
workflow_dispatch: # Allows manual triggering | |
env: | |
UPSTREAM_REPO: "quarkusio/quarkus" # Source repo (upstream) | |
FORK_REPO: "fugerit-org/quarkus" # Destination repo (your fork) | |
BRANCH: "main" # Branch to sync | |
GIT_USER_NAME: "Matteo Franci a.k.a. Fugerit" # Git username (configurable) | |
GIT_USER_EMAIL: "[email protected]" # Git email (configurable) | |
permissions: | |
contents: write # ✅ Grants write access to push changes to the fork | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.FORK_REPO }} | |
token: ${{ secrets.PAT_GITHUB }} # Use a Personal Access Token (PAT) | |
- name: Set up Git | |
run: | | |
git config --global user.name "${{ env.GIT_USER_NAME }}" | |
git config --global user.email "${{ env.GIT_USER_EMAIL }}" | |
- name: Add upstream and fetch latest changes | |
run: | | |
git remote add upstream https://github.com/${{ env.UPSTREAM_REPO }}.git || true | |
git fetch upstream | |
- name: Merge upstream changes | |
run: | | |
git merge upstream/${{ env.BRANCH }} | |
- name: Push changes to fork using PAT | |
run: | | |
git push https://${{ secrets.PAT_GITHUB }}@github.com/${{ env.FORK_REPO }}.git ${{ env.BRANCH }} | |