Push latest KernelSU Source #210
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
name: Push latest KernelSU Source | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '16 * * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
submodules: 'true' | |
fetch-depth: 0 | |
- name: Update Repo | |
id: version | |
run: | | |
git config --global user.name "Sanju0910" | |
git config --global user.email "[email protected]" | |
git submodule sync | |
git submodule update --init --recursive | |
cd $GITHUB_WORKSPACE/KernelSU | |
git checkout main | |
git pull | |
cd .. && git add . | |
git commit -m "KernelSU: Sync with repo" | |
export NEW=$(git rev-parse HEAD) | |
echo "NEW_SHA=$NEW" >> $GITHUB_OUTPUT | |
- name: Push | |
if: "${{ github.sha != steps.version.outputs.NEW_SHA && env.ACCESS_TOKEN != ''}}" | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.ACCESS_TOKEN }} |