Skip to content

Update Check

Update Check #89

Workflow file for this run

name: Update Check
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
TZ: Asia/Shanghai
on:
schedule:
- cron: 0 0 * * 5
workflow_dispatch:
inputs:
param:
description: 'ssh'
required: false
default: ''
jobs:
check:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Get Commit Hash
id: getHash
run: |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH .
echo "commitHash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v3
with:
path: .commitHash
key: HEAD-${{ steps.getHash.outputs.commitHash }}
- name: Save New Commit Hash
if: steps.cacheHash.outputs.cache-hit != 'true'
run: |
echo ${{ steps.getHash.outputs.commitHash }} | tee .commitHash
- name: Trigger build
if: steps.cacheHash.outputs.cache-hit != 'true'
run: |
sudo timedatectl set-timezone "$TZ"
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-d '{"event_type": "x86_64 ${{ github.event.inputs.param }}", "client_payload": {"target": "x86_64"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-d '{"event_type": "ramips_mt7621 ${{ github.event.inputs.param }}", "client_payload": {"target": "ramips_mt7621"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-d '{"event_type": "ramips_mt7620 ${{ github.event.inputs.param }}", "client_payload": {"target": "ramips_mt7620"}}'
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
retain_days: 3
keep_minimum_runs: 0