Skip to content

Update packages-leo

Update packages-leo #8

name: Update packages-leo
on:
repository_dispatch:
release:
types: published
# push:
# branches:
# - main
# schedule:
# - cron: 0 18 */3 * *
watch:
types: started
workflow_dispatch:
env:
TZ: Asia/Shanghai
jobs:
merge:
runs-on: Ubuntu-22.04
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get -qq update
sudo -E apt-get -qq install git subversion git-core wget
sudo timedatectl set-timezone "$TZ"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Clone packages
run: |
cd $GITHUB_WORKSPACE
chmod +x packages-leo.sh
git clone -b leo https://github.com/14link/diy-package.git packages
cd packages
rm -Rf *
git rm --cache *
$GITHUB_WORKSPACE/packages-leo.sh
- name: Upload
run: |
[ -e $GITHUB_WORKSPACE/README.md ] && cp $GITHUB_WORKSPACE/README.md $GITHUB_WORKSPACE/packages
cd $GITHUB_WORKSPACE/packages
git add .
git commit -m "update$(TZ='Asia/Shanghai' date +@%Y%m%d)"
git push --quiet "https://${{ secrets.TOKEN }}@github.com/14link/diy-package.git"
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
continue-on-error: true
with:
retain_days: 2
keep_minimum_runs: 0