Skip to content

Commit

Permalink
perf: Personal Sync Upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
E85Addict committed Nov 8, 2024
1 parent 7f6a97a commit 633a328
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 77 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/build_pull_request.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Delete old workflow runs
on:
workflow_dispatch:
inputs:
days:
description: 'Number of days.'
required: true
default: 0
minimum_runs:
description: 'The minimum runs to keep for each workflow.'
required: true
default: 0
delete_workflow_pattern:
description: 'The name of the workflow. if not set then it will target all workflows.'
required: false

jobs:
del_runs:
runs-on: ubuntu-22.04
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
26 changes: 0 additions & 26 deletions .github/workflows/open_pull_request.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release

on:
workflow_call:
workflow_dispatch:
push:
branches:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/sync_upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Sync upstream
on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 */8 * * *"

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}

- name: sync
id: sync
shell: bash
run: |
git config --global user.name 'E85Addict'
git config --global user.email '77761710+E85Addict@users.noreply.github.com'
if [[ $(git log | grep Author | head -1) == *"semantic"* ]]; then
git reset --hard HEAD~1
fi
T=$(git tag --sort=creatordate | tail -1)
git remote add upstream https://github.com/revanced/revanced-cli
git tag -d $(git tag -l)
git fetch upstream --tags -f
LatestRemoteTag=$(curl -s https://api.github.com/repos/revanced/revanced-cli/releases/latest | jq -r '.tag_name')
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 push origin --delete $T
git rebase -X ours upstream/main
git push --tags -f
git push origin --delete $LatestRemoteTag
git push -f
else
echo "in sync"
fi
- name: Delete old workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 10
19 changes: 0 additions & 19 deletions .github/workflows/update_documentation.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
],
successComment: false
}
],
[
"@saithodev/semantic-release-backmerge",
{
backmergeBranches: [{"from": "main", "to": "dev"}],
clearWorkspace: true
}
]
]
}

0 comments on commit 633a328

Please sign in to comment.