From 4184738aef067847fdf6e8899fc937ae6ed75fa5 Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 11 Nov 2025 17:23:28 +0000 Subject: [PATCH 1/5] update diff check to ignore gitignore, ISSUE_TEMPLATE and update-deps.yml --- .github/workflows/skip-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/skip-ci.yml b/.github/workflows/skip-ci.yml index 93af26ae70..c0f25b8e60 100644 --- a/.github/workflows/skip-ci.yml +++ b/.github/workflows/skip-ci.yml @@ -45,13 +45,13 @@ jobs: if: steps.check-pr.outputs.is-pr == 'true' id: check_diff run: | - skipList=(".github/CODEOWNERS" ".prettierignore") + skipList=(".github/CODEOWNERS" ".prettierignore" "*/.gitignore" ".github/ISSUE_TEMPLATE" ".github/workflows/update-deps.yml") # Ignores changelog.md, readme.md,... fileChangesArray=($(git diff --name-only "$BASE_REF...$HEAD_REF" | grep -v '\.md$' || true)) printf '%s\n' "${fileChangesArray[@]}" for item in "${fileChangesArray[@]}" do - if [[ ! " ${skipList[@]} " =~ " ${item} " ]]; then + if [[ ! " ${item} " =~ " ${skipList[@]} " ]]; then echo "found '${item}' that doesn't belong to the skip list." exit 0 fi From 94c2d2ae3d9960bbaa5561254cf433caec746e49 Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 11 Nov 2025 17:26:57 +0000 Subject: [PATCH 2/5] test root gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0467cca1e1..038fe3712d 100644 --- a/.gitignore +++ b/.gitignore @@ -94,3 +94,4 @@ node_modules.bak # SwiftLint swiftlint/* +#test change From ce51958d2d885a4af0f7bd107ddd7167219b6698 Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 11 Nov 2025 17:28:26 +0000 Subject: [PATCH 3/5] also skip for skip-ci --- .github/workflows/skip-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/skip-ci.yml b/.github/workflows/skip-ci.yml index c0f25b8e60..5cc14f72fd 100644 --- a/.github/workflows/skip-ci.yml +++ b/.github/workflows/skip-ci.yml @@ -45,7 +45,7 @@ jobs: if: steps.check-pr.outputs.is-pr == 'true' id: check_diff run: | - skipList=(".github/CODEOWNERS" ".prettierignore" "*/.gitignore" ".github/ISSUE_TEMPLATE" ".github/workflows/update-deps.yml") + skipList=(".github/CODEOWNERS" ".prettierignore" "*/.gitignore" ".github/ISSUE_TEMPLATE" ".github/workflows/update-deps.yml" ".github/workflows/skip-ci.yml") # Ignores changelog.md, readme.md,... fileChangesArray=($(git diff --name-only "$BASE_REF...$HEAD_REF" | grep -v '\.md$' || true)) printf '%s\n' "${fileChangesArray[@]}" From c43af74c6b42f023fabb668c34b74de58ebd8b60 Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 11 Nov 2025 17:33:30 +0000 Subject: [PATCH 4/5] nit regex --- .github/workflows/skip-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/skip-ci.yml b/.github/workflows/skip-ci.yml index 5cc14f72fd..8b00380c77 100644 --- a/.github/workflows/skip-ci.yml +++ b/.github/workflows/skip-ci.yml @@ -45,7 +45,7 @@ jobs: if: steps.check-pr.outputs.is-pr == 'true' id: check_diff run: | - skipList=(".github/CODEOWNERS" ".prettierignore" "*/.gitignore" ".github/ISSUE_TEMPLATE" ".github/workflows/update-deps.yml" ".github/workflows/skip-ci.yml") + skipList=(".github/CODEOWNERS" ".prettierignore" "*/.gitignore" ".github/ISSUE_TEMPLATE" ".github/workflows/update-deps\.yml" ".github/workflows/skip-ci\.yml") # Ignores changelog.md, readme.md,... fileChangesArray=($(git diff --name-only "$BASE_REF...$HEAD_REF" | grep -v '\.md$' || true)) printf '%s\n' "${fileChangesArray[@]}" From 1943eec60d3d9f00d8c0673997440d31b19b02a5 Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 11 Nov 2025 18:12:45 +0000 Subject: [PATCH 5/5] refactor logic to accept a list of regex --- .github/workflows/skip-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/skip-ci.yml b/.github/workflows/skip-ci.yml index 8b00380c77..7c667d0318 100644 --- a/.github/workflows/skip-ci.yml +++ b/.github/workflows/skip-ci.yml @@ -45,13 +45,21 @@ jobs: if: steps.check-pr.outputs.is-pr == 'true' id: check_diff run: | - skipList=(".github/CODEOWNERS" ".prettierignore" "*/.gitignore" ".github/ISSUE_TEMPLATE" ".github/workflows/update-deps\.yml" ".github/workflows/skip-ci\.yml") + skipList=(".github/CODEOWNERS" ".prettierignore" ".github/workflows/update-deps.yml" ".github/workflows/skip-ci.yml") + skipRegList=("(.*/)?\.gitignore" "\.github/ISSUE_TEMPLATE.*") + + for s in "${skipRegList[@]}"; do + skipRegex+="$s|" + done + # Remove trailing | + skipRegex=${skipRegex%|} + # Ignores changelog.md, readme.md,... fileChangesArray=($(git diff --name-only "$BASE_REF...$HEAD_REF" | grep -v '\.md$' || true)) printf '%s\n' "${fileChangesArray[@]}" for item in "${fileChangesArray[@]}" do - if [[ ! " ${item} " =~ " ${skipList[@]} " ]]; then + if [[ ! " ${skipList[*]} " =~ " ${item} " ]] && [[ ! "${item}" =~ ^(${skipRegex})$ ]]; then echo "found '${item}' that doesn't belong to the skip list." exit 0 fi