Check Packages #56
This file contains 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
# | |
# Copyright (c) 2019-2021 P3TERX <https://p3terx.com> | |
# | |
# This is free software, licensed under the MIT License. | |
# See /LICENSE for more information. | |
# | |
# https://github.com/P3TERX/Actions-OpenWrt | |
# File: .github/workflows/update-checker.yml | |
# Description: Source code update checker | |
# | |
name: Check | |
run-name: Check Packages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
PASSWALL_URL: https://github.com/xiaorouji/openwrt-passwall | |
on: | |
#push: | |
# paths: | |
# - '.github/workflows/update-checker.yml' | |
# - '.github/workflows/OWRT-CORE.yml' | |
#自动触发:每天早上4点(UTC 20:00) --分 时 日 月 周 | |
schedule: | |
- cron: 0 */8 * * * | |
#手动触发 | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
check_passwall_hash: | |
runs-on: ubuntu-latest | |
name: Check ${{matrix.branch}} | |
strategy: | |
fail-fast: false | |
matrix: | |
branch: [packages,luci] | |
outputs: | |
passwall_update: ${{ steps.save_passwallHash.outputs.passwall_update }} | |
steps: | |
- name: Get SSR Hash | |
id: get_passwallHash | |
run: | | |
git clone --depth 1 $PASSWALL_URL -b ${{matrix.branch}} . | |
echo "{passwallHash}={git rev-parse HEAD}" >> $GITHUB_OUTPUT | |
- name: Compare Passwall Hash | |
id: cache_passwallHash | |
uses: actions/[email protected] | |
with: | |
path: .passwallHash | |
key: HEAD-${{ steps.get_passwallHash.outputs.passwallHash }} | |
- name: Save New Passwall Hash | |
id: save_passwallHash | |
if: steps.cache_passwallHash.outputs.cache-hit != 'true' | |
run: | | |
echo ${{ steps.get_passwallHash.outputs.passwallHash }} | tee .passwallHash | |
passwall_update='true' | |
echo "passwall_update=${passwall_update}" >> $GITHUB_OUTPUT | |
echo "passwall_update: ${passwall_update}" | |
passwall_sync_build: | |
needs: [check_passwall_hash] | |
if: needs.check_passwall_hash.outputs.passwall_update == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger Sync | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ secrets.ACCESS_TOKEN }} | |
event-type: Source Code Update | |
- name: Delete Old Workflows | |
uses: Mattraks/[email protected] | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
#计算到目前为止每个工作流已保留的天数, 达到指定的天数工作流将被删除 | |
retain_days: 1 | |
#为每个工作流保留的最少运行次数 | |
keep_minimum_runs: 0 | |
# ######################################################## | |