[TOOLS] Use @v2 checkout
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user