forked from ReVanced/revanced-cli
-
Notifications
You must be signed in to change notification settings - Fork 3
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
5 changed files
with
72 additions
and
7 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
push: | ||
branches: | ||
- main | ||
|
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,49 @@ | ||
name: Sync upstream | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 15 * * *" | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: sync | ||
id: sync | ||
shell: bash | ||
run: | | ||
git config --global user.name 'j-hc' | ||
git config --global user.email 'j-hc@users.noreply.github.com' | ||
if [[ $(git log | grep Author | head -1) == *"semantic"* ]]; then | ||
git reset --hard HEAD~1 | ||
fi | ||
git remote add upstream https://github.com/revanced/revanced-cli | ||
C=$(git rev-list --left-right --count origin/main...remotes/upstream/main | awk '{print$2}') | ||
echo "ahead $C commits" | ||
if [ "$C" -gt 0 ]; then | ||
echo "rebasing" | ||
git tag -d $(git tag -l) | ||
git fetch upstream --tags -f | ||
git rebase -X ours upstream/main | ||
git push --tags -f | ||
git push -f https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git | ||
echo ::set-output name=SYNC::1 | ||
else | ||
echo "in sync" | ||
echo ::set-output name=SYNC::0 | ||
fi | ||
outputs: | ||
SYNC: ${{ steps.sync.outputs.SYNC }} | ||
|
||
build: | ||
needs: check | ||
uses: ./.github/workflows/release.yml | ||
if: ${{ needs.check.outputs.SYNC == 1 }} |
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
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
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