Skip to content

Commit

Permalink
Auto Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nijamaDev committed Feb 9, 2025
1 parent c49d291 commit 5beb14d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/auto-rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check updates and rebase

on:
schedule:
# Runs the workflow automatically every Sunday at 11:11 AM UTC
- cron: "11 11 * * 0"

jobs:
update:
runs-on: ubuntu-latest
env: # CONFIGURATION
branch: main # Declare the branch as an environment variable
upstream: https://github.com/benvinegar/counterscale # Repo
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ env.branch }}" # Use the branch variable
fetch-depth: 0 # Fetches all history for branch comparison
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # Uses PAT to authenticate

- name: Configure Git
run: |
git config --global user.name "nijamaDev"
git config --global user.email "[email protected]"
- name: Add upstream remote
run: |
git remote add upstream ${{ env.upstream }}
git fetch upstream
- name: Rebase with upstream
run: |
git checkout ${{ env.branch }}
git rebase upstream/${{ env.branch }}
- name: Force push to main
run: |
git push origin ${{ env.branch }} --force

0 comments on commit 5beb14d

Please sign in to comment.