From 9fc47b3d416f54970c30bce0a33cb51eb939e7fd Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Wed, 13 May 2026 13:21:26 +0200 Subject: [PATCH] ci: gate workflows on relevant source paths - ci.yml: only run on Go/frontend source and lockfiles. - codeql.yml: scope push/PR triggers to Go and JS/TS sources; weekly cron still does a full scan. - release.yml: add matching paths allowlist to pull_request so doc/workflow-only PRs don't kick off the multi-arch build. Skips workflow runs on changes to docs, translations, GitHub configs, and unrelated scripts. --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/codeql.yml | 23 ++++++++++++++++++++--- .github/workflows/release.yml | 11 +++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37485e5b..31a6a70b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,37 @@ name: CI on: pull_request: + paths: + - "**.go" + - "go.mod" + - "go.sum" + - "**.js" + - "**.mjs" + - "**.cjs" + - "**.ts" + - "**.vue" + - "**.html" + - "**.css" + - "frontend/package.json" + - "frontend/package-lock.json" + - ".nvmrc" push: branches: - main + paths: + - "**.go" + - "go.mod" + - "go.sum" + - "**.js" + - "**.mjs" + - "**.cjs" + - "**.ts" + - "**.vue" + - "**.html" + - "**.css" + - "frontend/package.json" + - "frontend/package-lock.json" + - ".nvmrc" permissions: contents: read diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6b397b61..91da8d5e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,7 +4,27 @@ on: push: tags-ignore: - "v*" + paths: + - "**.go" + - "go.mod" + - "go.sum" + - "**.js" + - "**.mjs" + - "**.cjs" + - "**.ts" + - "**.vue" + - "frontend/package-lock.json" pull_request: + paths: + - "**.go" + - "go.mod" + - "go.sum" + - "**.js" + - "**.mjs" + - "**.cjs" + - "**.ts" + - "**.vue" + - "frontend/package-lock.json" schedule: - cron: "18 2 * * 2" @@ -35,9 +55,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 - # The Go binary embeds web/dist/ via //go:embed all:dist (web/web.go). - # web/dist/ is .gitignored, so CodeQL's autobuild for Go will fail with - # "pattern all:dist: no matching files found" unless vite emits it first. - name: Setup Node.js if: matrix.language == 'go' uses: actions/setup-node@v6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b031967..3b638eab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,17 @@ on: - "x-ui.service.arch" - "x-ui.service.rhel" pull_request: + paths: + - "**.js" + - "**.css" + - "**.html" + - "**.sh" + - "**.go" + - "go.mod" + - "go.sum" + - "x-ui.service.debian" + - "x-ui.service.arch" + - "x-ui.service.rhel" jobs: build: