Skip to content

Update Checker

Update Checker #46

name: Update Checker
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
on:
workflow_dispatch:
schedule:
- cron: 0 22 * * *
jobs:
check:
runs-on: ubuntu-latest
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'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.ACTIONS_TRIGGER_PAT }}
event-type: Source Code Update
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
retain_days: 2
keep_minimum_runs: 0