Browse Source

Create sync-to-latest.yml

pull/159/head
Abdul Rahman 2 years ago
committed by GitHub
parent
commit
5962550c50
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 46
      .github/workflows/sync-to-latest.yml

46
.github/workflows/sync-to-latest.yml

@ -0,0 +1,46 @@
name: Sync with Upstream
on:
push:
branches:
- main
schedule:
- cron: '0 * * * *' # Runs every hour to check for updates, adjust the cron as needed
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout the forked repo
uses: actions/checkout@v3
with:
repository: abdbbdii/go-whatsapp-web-multidevice-abd
ref: main
- name: Add Upstream Repository
run: git remote add upstream https://github.com/aldinokemal/go-whatsapp-web-multidevice
- name: Fetch Upstream Changes
run: git fetch upstream
- name: Merge Upstream Changes
run: |
git checkout -b update-upstream
git merge upstream/main --no-commit --no-ff
git checkout --ours src/cmd/root.go # Keep your version of root.go
git add src/cmd/root.go
git commit -m "Merge upstream changes"
git checkout main
git merge update-upstream
git branch -d update-upstream
- name: Install Go Dependencies
run: go get github.com/joho/godotenv
- name: Push Changes to Forked Repo
run: |
git config user.name "GitHub Action"
git config user.email "action@github.com"
git push origin main
Loading…
Cancel
Save