forked from benvinegar/counterscale
-
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
39 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,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 |