From e4b5119ed70be7c393ba95aecad371b7983ec084 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Mon, 23 Nov 2026 15:40:02 +0100 Subject: [PATCH 1/2] ci: inline the pre-commit run instead of pre-commit/action The organization action policy requires every action to be pinned to a full-length commit SHA - including transitive ones. pre-commit/action wraps actions/cache@v4 by tag, so the pre-commit job is rejected at the action-download step. Run the hooks directly instead (the wrapper only added caching). Part of DIRACGrid/.github#5. --- .github/workflows/pre-commit.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 92fb76b..74408e2 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -24,4 +24,9 @@ jobs: - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: 3.x - - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 + # pre-commit/action is not used because it wraps actions/cache@v4 (by + # tag, not SHA), which the organization action policy rejects + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit + run: pre-commit run --all-files --show-diff-on-failure From 5788714faa33b7d5f552627b645686fc0ea91936 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Mon, 23 Nov 2026 15:59:52 +0100 Subject: [PATCH 2/2] chore: pin the pre-commit version (4.7.0) in CI Match .github#16: an unpinned 'pip install pre-commit' drifts with the runners; pin it so the hook environments are reproducible. --- .github/workflows/pre-commit.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 74408e2..2fc9414 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -24,9 +24,8 @@ jobs: - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: 3.x - # pre-commit/action is not used because it wraps actions/cache@v4 (by - # tag, not SHA), which the organization action policy rejects + # Not pre-commit/action: it calls actions/cache by tag, which the organization policy rejects. - name: Install pre-commit - run: pip install pre-commit + run: pip install pre-commit==4.7.0 - name: Run pre-commit - run: pre-commit run --all-files --show-diff-on-failure + run: pre-commit run --all-files --show-diff-on-failure --color=always