Skip to content

Commit

Permalink
ci: use path whitelist instead of blacklist
Browse files Browse the repository at this point in the history
That is, replace `paths-ignore` with `paths`.

This should reduce the number of unnecessary executions and the
frequency at which paths are changed.  It also reduces the overall
number of paths used.
  • Loading branch information
kmk3 committed Aug 16, 2023
1 parent 22d233c commit de6f0a0
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 174 deletions.
70 changes: 22 additions & 48 deletions .github/workflows/build-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,29 @@ name: Build-extra

on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- 'contrib/syntax/**'
- 'contrib/vim/**'
- 'etc/**'
- 'src/man/*.in'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/codespell.yml
- .github/workflows/profiles.yml
- .github/workflows/python.yml
- .github/workflows/test.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
- COPYING
- README
- README.md
- RELNOTES
- SECURITY.md
- src/firecfg/firecfg.config
paths:
- 'src/**.c'
- 'src/**.h'
- 'src/**.mk'
- 'src/**Makefile'
- .github/workflows/build-extra.yml
- Makefile
- config.mk.in
- config.sh.in
- configure
- configure.ac
pull_request:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- 'contrib/syntax/**'
- 'contrib/vim/**'
- 'etc/**'
- 'src/man/*.in'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/codespell.yml
- .github/workflows/profiles.yml
- .github/workflows/python.yml
- .github/workflows/test.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
- COPYING
- README
- README.md
- RELNOTES
- SECURITY.md
- src/firecfg/firecfg.config
paths:
- 'src/**.c'
- 'src/**.h'
- 'src/**.mk'
- 'src/**Makefile'
- .github/workflows/build-extra.yml
- Makefile
- config.mk.in
- config.sh.in
- configure
- configure.ac

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand Down
65 changes: 33 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
name: Build

# Note: Keep this list in sync with DISTFILES in ../../Makefile.
on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build-extra.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/codespell.yml
- .github/workflows/profiles.yml
- .github/workflows/python.yml
- .github/workflows/test.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
paths:
- 'contrib/**'
- 'etc/**'
- 'm4/**'
- 'platform/**'
- 'src/**'
- 'test/**'
- .github/workflows/build.yml
- COPYING
- Makefile
- README
- README.md
- RELNOTES
- SECURITY.md
- config.mk.in
- config.sh.in
- configure
- configure.ac
- install.sh
- mkdeb.sh
- mketc.sh
pull_request:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build-extra.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/codespell.yml
- .github/workflows/profiles.yml
- .github/workflows/python.yml
- .github/workflows/test.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
paths:
- 'contrib/**'
- 'etc/**'
- 'm4/**'
- 'platform/**'
- 'src/**'
- 'test/**'
- .github/workflows/build.yml
- COPYING
- Makefile
- README
- README.md
- RELNOTES
- SECURITY.md
- config.mk.in
- config.sh.in
- configure
- configure.ac
- install.sh
- mkdeb.sh
- mketc.sh

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand Down
70 changes: 22 additions & 48 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,29 @@ name: CodeQL

on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- 'contrib/syntax/**'
- 'contrib/vim/**'
- 'etc/**'
- 'src/man/*.txt'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build-extra.yml
- .github/workflows/build.yml
- .github/workflows/codespell.yml
- .github/workflows/profiles.yml
- .github/workflows/python.yml
- .github/workflows/test.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
- COPYING
- README
- README.md
- RELNOTES
- SECURITY.md
- src/firecfg/firecfg.config
paths:
- 'src/**.c'
- 'src/**.h'
- 'src/**.mk'
- 'src/**Makefile'
- .github/workflows/codeql-analysis.yml
- Makefile
- config.mk.in
- config.sh.in
- configure
- configure.ac
pull_request:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- 'contrib/syntax/**'
- 'contrib/vim/**'
- 'etc/**'
- 'src/man/*.txt'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build-extra.yml
- .github/workflows/build.yml
- .github/workflows/codespell.yml
- .github/workflows/profiles.yml
- .github/workflows/python.yml
- .github/workflows/test.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
- COPYING
- README
- README.md
- RELNOTES
- SECURITY.md
- src/firecfg/firecfg.config
paths:
- 'src/**.c'
- 'src/**.h'
- 'src/**.mk'
- 'src/**Makefile'
- .github/workflows/codeql-analysis.yml
- Makefile
- config.mk.in
- config.sh.in
- configure
- configure.ac
schedule:
- cron: '0 7 * * 2'

Expand Down
72 changes: 26 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,33 @@ name: Test

on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- 'contrib/syntax/**'
- 'contrib/vim/**'
- 'etc/**'
- 'src/man/*.in'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build.yml
- .github/workflows/build-extra.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/codespell.yml
- .github/workflows/profile-checks.yml
- .github/workflows/python.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
- COPYING
- README
- README.md
- RELNOTES
- SECURITY.md
paths:
- 'src/**.c'
- 'src/**.h'
- 'src/**.mk'
- 'src/**Makefile'
- 'test/**'
- .github/workflows/test.yml
- Makefile
- config.mk.in
- config.sh.in
- configure
- configure.ac
- src/firecfg/firecfg.config
pull_request:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- 'contrib/syntax/**'
- 'contrib/vim/**'
- 'etc/**'
- 'src/man/*.in'
- .git-blame-ignore-revs
- .github/dependabot.yml
- .github/pull_request_template.md
- .github/workflows/build.yml
- .github/workflows/build-extra.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/codespell.yml
- .github/workflows/profile-checks.yml
- .github/workflows/python.yml
- .gitignore
- .gitlab-ci.yml
- CONTRIBUTING.md
- COPYING
- README
- README.md
- RELNOTES
- SECURITY.md
paths:
- 'src/**.c'
- 'src/**.h'
- 'src/**.mk'
- 'src/**Makefile'
- 'test/**'
- .github/workflows/test.yml
- Makefile
- config.mk.in
- config.sh.in
- configure
- configure.ac
- src/firecfg/firecfg.config

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ uninstall: config.mk
rm -f $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs/firejail-profile.lang
@echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038."

# Note: Keep this list in sync with `paths` in .github/workflows/build.yml.
DISTFILES = \
COPYING \
Makefile \
Expand Down

0 comments on commit de6f0a0

Please sign in to comment.