Skip to content

sync

sync #77

name: sync
on:
workflow_dispatch:
repository_dispatch:
types: [sync]
permissions:
contents: write
jobs:
build:
name: sync
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
ref: main
- name: Download kernel module
run: |
kmod=$(curl -sk "https://api.github.com/repos/sbwml/builder/releases/latest" | grep "browser_download_url" | grep "aarch64-6.6" | tail -1 | awk '{print $2}' | sed 's/\"//g')
kmod_name=$(basename $kmod | sed 's/\.tar\.gz$//;s/aarch64-//')
rm -rf $kmod_name
curl -L $kmod -o $kmod_name.tar.gz --progress-bar
tar zxf $kmod_name.tar.gz && rm -f $kmod_name.tar.gz
echo "RELEASE_NAME=$kmod_name" >> "$GITHUB_ENV"
- name: Git push
run: |
sed -i '/url =/d' ./.git/config
git config --local user.name "actions"
git config --local user.email "action@github.com"
git add --all
git commit -m "${{ env.RELEASE_NAME }}"
git remote set-url --add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git fetch --unshallow origin
git push -u origin main