Skip to content

Commit 6c91e4f

Browse files
Add a generic upstream pull script that triggers based on event
Signed-off-by: Jayant-Deshmukh <[email protected]>
1 parent 946361d commit 6c91e4f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/sync.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Sync with upstream
2+
3+
on:
4+
workflow_dispatch:
5+
6+
repository_dispatch:
7+
types: [sync_trigger]
8+
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Git
20+
run: |
21+
git config user.name "Jayant-Deshmukh"
22+
git config user.email "[email protected]"
23+
24+
- name: Add upstream remote and rebase
25+
run: |
26+
git config --global pull.rebase true
27+
REPO_NAME="${GITHUB_REPOSITORY##*/}" # Extract the repository name from the GitHub repository context
28+
git pull https://github.com/LineageOS/android_${REPO_NAME}.git lineage-22.1
29+
30+
- name: Push rebased changes to origin
31+
run: |
32+
git push origin HEAD:fifteen-los --force-with-lease

0 commit comments

Comments
 (0)