From a9424fc3048ab9a613e4d22ffd9718173b08a8b9 Mon Sep 17 00:00:00 2001 From: Olivier Cots Date: Fri, 13 Nov 2026 16:17:52 +0100 Subject: [PATCH] ci-main: issue and pull request templates never affect a job Co-Authored-By: Claude Sonnet 5.5 --- docs/workflows/ci-on-main.md | 3 ++- scripts/ci-main/changes.jl | 8 ++++---- scripts/ci-main/test/runtests.jl | 6 ++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/workflows/ci-on-main.md b/docs/workflows/ci-on-main.md index 5e77767..7c0c2db 100644 --- a/docs/workflows/ci-on-main.md +++ b/docs/workflows/ci-on-main.md @@ -72,7 +72,8 @@ repository: Besides, a file never affects any job when it is a root file of documentation or configuration: `*.md` (`AGENTS.md`, `CHANGELOG.md`, `README.md`…), `.gitignore`, `LICENSE`, -`CITATION.cff`, `_typos.toml`, `.markdownlint.json`, `.JuliaFormatter.toml`, `formatter.lock`. +`CITATION.cff`, `_typos.toml`, `.markdownlint.json`, `.JuliaFormatter.toml`, `formatter.lock`, and the issue and +pull request templates (`.github/ISSUE_TEMPLATE/`, `.github/pull_request_template.md`): no workflow reads them. A file in one of the known directories of another scope (`docs/` for the tests, `test/` for the documentation) does not affect this one. **Anything else counts**: `.github/` (a workflow change can change what runs), a new top-level directory, a file the script does not diff --git a/scripts/ci-main/changes.jl b/scripts/ci-main/changes.jl index 8886754..f85e853 100644 --- a/scripts/ci-main/changes.jl +++ b/scripts/ci-main/changes.jl @@ -53,8 +53,8 @@ const SCOPES = Dict( "The top-level directories that belong to a scope above: a change in one of them leaves the other scopes alone." const KNOWN_DIRS = ["src/", "ext/", "test/", "docs/"] -"Root files that change nothing a job runs: documentation and configuration of the repository." -const IGNORED = r"^(?:[^/]+\.md|\.gitignore|LICENSE|CITATION\.cff|_typos\.toml|\.markdownlint\.json|\.JuliaFormatter\.toml|formatter\.lock)$" +"Files that change nothing a job runs: the root documentation and configuration of the repository, and the issue and pull request templates." +const IGNORED = r"^(?:[^/]+\.md|\.gitignore|LICENSE|CITATION\.cff|_typos\.toml|\.markdownlint\.json|\.JuliaFormatter\.toml|formatter\.lock|\.github/ISSUE_TEMPLATE/.+|\.github/pull_request_template\.md)$" allowed_actors() = filter(!isempty, strip.(split(get(ENV, "CT_CI_CHANGES_ONLY_ACTORS", join(DEFAULT_ACTORS, ",")), ","))) @@ -63,8 +63,8 @@ allowed_actors() = filter(!isempty, strip.(split(get(ENV, "CT_CI_CHANGES_ONLY_AC Whether a change to `file` (a path from the root) can affect the jobs of `scope`. A file in one of the scope's directories does; a root file of documentation or configuration, or a -directory that belongs to another scope, does not; anything else (`.github/`, a new -top-level directory) does, because we cannot tell. +directory that belongs to another scope, or an issue or pull request template, does not; +anything else (the rest of `.github/`, a new top-level directory) does, because we cannot tell. """ function relevant(scope::AbstractString, file::AbstractString) for p in SCOPES[scope] diff --git a/scripts/ci-main/test/runtests.jl b/scripts/ci-main/test/runtests.jl index 1089eb7..af0db86 100644 --- a/scripts/ci-main/test/runtests.jl +++ b/scripts/ci-main/test/runtests.jl @@ -77,7 +77,13 @@ end @test !relevant(s, "CHANGELOG.md") @test !relevant(s, "AGENTS.md") @test !relevant(s, ".gitignore") + @test !relevant(s, ".github/ISSUE_TEMPLATE/bug.yml") + @test !relevant(s, ".github/ISSUE_TEMPLATE/config.yml") + @test !relevant(s, ".github/pull_request_template.md") @test relevant(s, ".github/workflows/CI.yml") # unknown: run + @test relevant(s, ".github/dependabot.yml") + @test relevant(s, ".github/ISSUE_TEMPLATE") # the folder itself, not a template + @test relevant(s, "sub/.github/ISSUE_TEMPLATE/bug.yml") @test relevant(s, "newdir/file.jl") end end