From bf22535f612686c511b414d49a834f0701f2173a Mon Sep 17 00:00:00 2001 From: Mortifia Date: Wed, 15 Jul 2026 04:22:51 +0200 Subject: [PATCH 1/2] ci: bloque les trailers de co-auteur IA sur les commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vérifie chaque commit d'une PR (et le HEAD d'un push direct sur main/master) pour un trailer Co-authored-by mentionnant un outil IA (Claude, Copilot, ChatGPT...) et échoue le check si trouvé. --- .github/workflows/no-ai-coauthor.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/no-ai-coauthor.yml diff --git a/.github/workflows/no-ai-coauthor.yml b/.github/workflows/no-ai-coauthor.yml new file mode 100644 index 0000000..8a200b7 --- /dev/null +++ b/.github/workflows/no-ai-coauthor.yml @@ -0,0 +1,36 @@ +name: No AI co-author + +on: + pull_request: + push: + branches: [main, master] + +jobs: + check-commits: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Refuse AI co-author trailers (PR commits) + if: github.event_name == 'pull_request' + run: | + set -euo pipefail + bad=0 + for sha in $(git log --format='%H' "origin/${{ github.event.pull_request.base.ref }}..HEAD"); do + if git log -1 --format='%B' "$sha" | grep -iqE '^co-authored-by:.*(claude|anthropic|copilot|chatgpt|openai|gemini|codex)'; then + echo "::error::Commit $sha has an AI co-author trailer — not allowed in this repo." + bad=1 + fi + done + exit $bad + + - name: Refuse AI co-author trailers (direct push) + if: github.event_name == 'push' + run: | + set -euo pipefail + if git log -1 --format='%B' HEAD | grep -iqE '^co-authored-by:.*(claude|anthropic|copilot|chatgpt|openai|gemini|codex)'; then + echo "::error::HEAD commit has an AI co-author trailer — not allowed in this repo." + exit 1 + fi From 37628a3e0a7ba3a1c499ffc026f0dc67e37e28e9 Mon Sep 17 00:00:00 2001 From: Mortifia Date: Wed, 15 Jul 2026 04:27:46 +0200 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20restreint=20GITHUB=5FTOKEN=20=C3=A0?= =?UTF-8?q?=20contents:read=20(relev=C3=A9=20par=20CodeQL)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/no-ai-coauthor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/no-ai-coauthor.yml b/.github/workflows/no-ai-coauthor.yml index 8a200b7..f0c6176 100644 --- a/.github/workflows/no-ai-coauthor.yml +++ b/.github/workflows/no-ai-coauthor.yml @@ -5,6 +5,9 @@ on: push: branches: [main, master] +permissions: + contents: read + jobs: check-commits: runs-on: ubuntu-latest