Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Update Checker

Update Checker #22

name: Update Checker
env:
REPO_URL: https://github.com/coolsnowwolf/lede.git
REPO_BRANCH: master
on:
workflow_dispatch:
#schedule:
# - cron: 0 */18 * * *
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Get Commit Hash
id: getHash
run: |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH .
echo "::set-output name=commitHash::$(git rev-parse HEAD)"
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v2
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@v1
with:
token: ${{ secrets.ACTION_TOKEN }}
event-type: Source Code Update
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ secrets.ACTION_TOKEN }}
repository: ${{ github.repository }}
retain_days: 1
keep_minimum_runs: 1