Skip to content

Commit

Permalink
Update lighthouse-badger.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sishenyuan authored Dec 26, 2024
1 parent c0d5cbc commit a1d8cd5
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/lighthouse-badger.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# Lighthouse-Badger-Easy | GitHub Action Workflow
#
# Description: Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL(s) to the current repository & main branch with minimal settings
# Author: Sitdisch
# Source: https://github.com/myactionway/lighthouse-badger-workflows
# License: MIT
# Copyright (c) 2021 Sitdisch

name: "Lighthouse Badger"

########################################################################
Expand All @@ -23,10 +15,8 @@ env:
# TRIGGERS
on:
page_build:
# schedule: # Check your schedule here => https://crontab.guru/
# - cron: '55 23 * * 0' # e.g. every Sunday at 23:55
#
# THAT'S IT; YOU'RE DONE;
schedule: # Check your schedule here => https://crontab.guru/
- cron: '55 23 * * 0' # e.g. every Sunday at 23:55
workflow_dispatch:

########################################################################
Expand All @@ -36,26 +26,36 @@ on:
jobs:
lighthouse-badger-easy:
runs-on: ubuntu-latest
timeout-minutes: 8
timeout-minutes: 15 # 增加超时时间,避免复杂任务超时
steps:
# Step 1: 解析 REPOSITORY 和 BRANCH
- name: Preparatory Tasks
run: |
REPOSITORY=`expr "${{ env.REPO_BRANCH }}" : "\([^ ]*\)"`
BRANCH=`expr "${{ env.REPO_BRANCH }}" : ".* \([^ ]*\)"`
REPOSITORY=$(echo "${{ env.REPO_BRANCH }}" | awk '{print $1}')
BRANCH=$(echo "${{ env.REPO_BRANCH }}" | awk '{print $2}')
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
env:
REPO_BRANCH: ${{ env.REPO_BRANCH }}
- uses: actions/checkout@v4

# Step 2: 检出目标仓库代码
- name: Checkout Target Repository
uses: actions/checkout@v4
with:
repository: ${{ env.REPOSITORY }}
token: ${{ secrets.LIGHTHOUSE_BADGER_TOKEN }}
ref: ${{ env.BRANCH }}
- uses: actions/checkout@v4

# Step 3: 检出 Lighthouse Badges 仓库
- name: Checkout Lighthouse Badges Repository
uses: actions/checkout@v4
with:
repository: "myactionway/lighthouse-badges"
path: temp_lighthouse_badges_nested
- uses: myactionway/[email protected]

# Step 4: 运行 Lighthouse-Badger Action
- name: Run Lighthouse-Badger
uses: myactionway/[email protected]
with:
urls: ${{ env.URLS }}
mobile_lighthouse_params: ${{ env.MOBILE_LIGHTHOUSE_PARAMS }}
Expand Down

0 comments on commit a1d8cd5

Please sign in to comment.