forked from LineageOS/android_vendor_lineage
-
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.
Add a generic upstream pull script that triggers based on event
Signed-off-by: Jayant-Deshmukh <[email protected]>
- Loading branch information
1 parent
ccaaaed
commit 6336257
Showing
1 changed file
with
32 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,32 @@ | ||
name: Sync with upstream | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
repository_dispatch: | ||
types: [sync_trigger] | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Git | ||
run: | | ||
git config user.name "Jayant-Deshmukh" | ||
git config user.email "[email protected]" | ||
- name: Add upstream remote and rebase | ||
run: | | ||
git config --global pull.rebase true | ||
REPO_NAME="${GITHUB_REPOSITORY##*/}" # Extract the repository name from the GitHub repository context | ||
git pull https://github.com/LineageOS/android_${REPO_NAME}.git lineage-22.1 | ||
- name: Push rebased changes to origin | ||
run: | | ||
git push origin HEAD:fifteen-los --force-with-lease |