diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index fe086aa..641d2f3 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -12,3 +12,4 @@ paths: - 'shellcheck reported issue in this script: SC2035:.+' # Info about glob patterns - 'shellcheck reported issue in this script: SC2153:.+' # False positive for environment variables - 'shellcheck reported issue in this script: SC2155:.+' # Declare and assign separately + - 'property ".+" is not defined in object type \{assertionresults: string; links: string; resultspath: string\}' # treosh/lighthouse-ci-action@v12 outputs not in actionlint db diff --git a/.github/workflows/lighthouse-scan.yml b/.github/workflows/lighthouse-scan.yml index 4df80ca..f6c4020 100644 --- a/.github/workflows/lighthouse-scan.yml +++ b/.github/workflows/lighthouse-scan.yml @@ -58,11 +58,12 @@ jobs: - name: format report summary if: always() && steps.audit.outcome != 'skipped' run: | - echo "### 🔦 Lighthouse Audit Results" >> $GITHUB_STEP_SUMMARY + echo "### Lighthouse Audit Results" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "| URL | Performance | Accessibility | Best Practices | SEO |" >> $GITHUB_STEP_SUMMARY - echo "|-----|-------------|---------------|----------------|-----|" >> $GITHUB_STEP_SUMMARY - echo '${{ steps.audit.outputs.manifest }}' | jq -r '.[] | "| \(.url) | \(.summary.performance * 100 | round)% | \(.summary.accessibility * 100 | round)% | \(.summary["best-practices"] * 100 | round)% | \(.summary.seo * 100 | round)% |"' >> $GITHUB_STEP_SUMMARY || true - echo "" >> $GITHUB_STEP_SUMMARY - echo "Full reports: ${{ steps.audit.outputs.links }}" >> $GITHUB_STEP_SUMMARY + MANIFEST=$(find .lighthouseci -name 'manifest.json' 2>/dev/null | head -1) + if [ -f "$MANIFEST" ]; then + echo "| URL | Performance | Accessibility | Best Practices | SEO |" >> $GITHUB_STEP_SUMMARY + echo "|-----|-------------|---------------|----------------|-----|" >> $GITHUB_STEP_SUMMARY + jq -r '.[] | "| \(.url) | \(.summary.performance * 100 | round)% | \(.summary.accessibility * 100 | round)% | \(.summary["best-practices"] * 100 | round)% | \(.summary.seo * 100 | round)% |"' "$MANIFEST" >> $GITHUB_STEP_SUMMARY || true + fi continue-on-error: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 728b1c5..f14a65c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,16 +28,18 @@ jobs: if [ "$REPO" = "tehw0lf/workflows" ]; then echo "is_workflow_repo=true" >> $GITHUB_OUTPUT echo "::notice::Running in workflows repository - write mode enabled" + echo "workflows_ref=${{ github.sha }}" >> $GITHUB_OUTPUT else echo "is_workflow_repo=false" >> $GITHUB_OUTPUT echo "::notice::Running in external repository - read-only mode" + echo "workflows_ref=main" >> $GITHUB_OUTPUT fi - name: Checkout workflow repository uses: actions/checkout@v7 with: repository: tehw0lf/workflows - ref: main + ref: ${{ steps.context.outputs.workflows_ref }} path: workflows-repo - name: Generate workflow hash for cache key