Update wechat2tg Checker #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# https://github.com/P3TERX/Actions-OpenWrt | |
# | |
# File: .github/workflows/update-checker.yml | |
# Description: Source code update checker | |
# | |
# Copyright (c) 2019-2024 P3TERX <https://p3terx.com> | |
# | |
# This is free software, licensed under the MIT License. | |
# See /LICENSE for more information. | |
# | |
name: Update wechat2tg Checker | |
env: | |
REPO_URL: https://github.com/finalpi/wechat2tg.git | |
REPO_BRANCH: master | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 30 18 * * 6 | |
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: commitHash_${{ 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: ${{ github.token }} | |
event-type: Source Code Update | |
- name: Delete workflow runs | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
retain_days: 0 | |
keep_minimum_runs: 2 |