From 037678c93d3cd1939477bea627f40663e5a460f3 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Fri, 5 Jun 2026 11:28:10 +0200 Subject: [PATCH] [TOOLS] Use @v2 checkout --- .github/workflows/update-filters.yml | 37 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update-filters.yml b/.github/workflows/update-filters.yml index e53d40d7..3b3ddc2b 100644 --- a/.github/workflows/update-filters.yml +++ b/.github/workflows/update-filters.yml @@ -13,18 +13,27 @@ jobs: runs-on: ubuntu-latest steps: + # ------------------------------- + # Checkout main branch + # ------------------------------- - name: Checkout main branch - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: repository: 'uazo/cromite' ref: main - fetch-depth: 1 path: main + fetch-depth: 1 + # ------------------------------- + # Prepare output directory + # ------------------------------- - name: Prepare output directory run: mkdir -p main/out/filters - - name: Download filter lists (fail-safe) + # ------------------------------- + # Download filter lists (fail-safe) + # ------------------------------- + - name: Download filter lists run: | set -e KO=0 @@ -32,11 +41,8 @@ jobs: while IFS= read -r line; do [ -z "$line" ] && continue - url="${line%%=*}" - file="${line#*=}" - - url=$(echo "$url" | xargs) - file=$(echo "$file" | xargs) + url=$(echo "$line" | cut -d '=' -f1 | xargs) + file=$(echo "$line" | cut -d '=' -f2 | xargs) if [ -z "$file" ]; then file=$(basename "$url") @@ -55,15 +61,20 @@ jobs: exit 1 fi - - name: Checkout gh-pages branch - if: success() - uses: actions/checkout@v4 + # ------------------------------- + # Checkout pages branch + # ------------------------------- + - name: Checkout pages branch + uses: actions/checkout@v2 with: repository: 'uazo/cromite' ref: pages - fetch-depth: 1 path: pages + fetch-depth: 1 + # ------------------------------- + # Deploy filters (only .txt) + # ------------------------------- - name: Deploy to pages run: | cd pages @@ -76,7 +87,7 @@ jobs: git config user.name "github-actions" git config user.email "github-actions@github.com" - # add ONLY txt files + # add ONLY .txt files find filters -type f -name "*.txt" -exec git add {} + if git diff --cached --quiet; then