Skip to content

修复ci首次新增app-meta.json时不会更新的问题 #3

修复ci首次新增app-meta.json时不会更新的问题

修复ci首次新增app-meta.json时不会更新的问题 #3

name: update app-meta.json
on:
push:
branches:
- master
paths:
- 'app-meta.json'
- '.github/workflows/app-meta-update.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set variables
run: |
echo "app_meta=https://raw.githubusercontent.com/LuckyPray/XAutoDaily/master/app-meta.json" >> $GITHUB_ENV
- name: Clone pages branch
uses: actions/checkout@v3.3.0
with:
ref: pages
- name: Update app-meta.json
run: |
curl -sSL ${app_meta} > app-meta.json
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
if [[ -n $(git status -s) ]]; then
git commit -m "Update app-meta.json"
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@${{ github.repository }}" pages:pages
fi