Skip to content

Commit e4bde6c

Browse files
authored
fix(pre-commit): remove deprecated stage name & port to GitHub Actions (#5)
1 parent 20883c9 commit e4bde6c

8 files changed

Lines changed: 44 additions & 184 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/close-issue.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

.github/workflows/open-issue.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # all branches
7+
tags:
8+
- "[0-9]+.[0-9]+.[0-9]+"
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
14+
permissions: {} # purposefully empty by default at workflow level, explicitly overridden for specific jobs below
15+
16+
jobs:
17+
pre-commit:
18+
name: Precommit check
19+
runs-on: blacksmith-4vcpu-ubuntu-2404
20+
permissions:
21+
contents: read
22+
packages: read # to be able to pull the pre-commit-runner image from ghcr.io
23+
container:
24+
image: ghcr.io/specklesystems/pre-commit-runner:latest # zizmor: ignore[unpinned-images] Speckle own this image repository
25+
steps:
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
27+
with:
28+
fetch-depth: 0
29+
persist-credentials: false
30+
- run: git config --global --add safe.directory $PWD
31+
- name: Set precommit
32+
run: pre-commit install-hooks --config ./.pre-commit-config.yaml
33+
- name: Run precommit
34+
run: pre-commit run --all-files --config ./.pre-commit-config.yaml
35+
- name: Diff on failure
36+
if: failure()
37+
run: git --no-pager diff

.pre-commit-config.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
default_stages:
2-
- 'commit'
2+
- 'pre-commit'
33

44
repos:
5-
- repo: https://github.com/pre-commit/mirrors-prettier
6-
rev: 'v2.7.1'
7-
hooks:
8-
- id: prettier
9-
105
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: 'v4.3.0'
6+
rev: 'v6.0.0'
127
hooks:
138
- id: check-yaml
149
- id: check-merge-conflict
@@ -20,12 +15,12 @@ repos:
2015
- id: end-of-file-fixer
2116

2217
- repo: https://github.com/syntaqx/git-hooks
23-
rev: 'v0.0.17'
18+
rev: 'v0.0.18'
2419
hooks:
2520
- id: forbid-binary
2621

2722
- repo: https://github.com/pre-commit/pre-commit
28-
rev: 'v2.20.0'
23+
rev: 'v4.5.1'
2924
hooks:
3025
- id: validate_manifest
3126

.pre-commit-hooks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- id: ggshield-not-ci
22
name: GitGuardian Shield (pre-commit)
33
description: Runs ggshield in non-CI environments to detect hardcoded secrets, security vulnerabilities and policy breaks.
4-
stages: [commit]
4+
stages: [pre-commit]
55
entry: hooks/ggshield-not-ci.sh
66
language: script

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/

hooks/ggshield-not-ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set -eo pipefail
44
if [[ -z "${CI}" ]]; then
55
ggshield secret scan pre-commit
66
else
7-
echo "In a CI environment, so skipping GitGuardian ggshield"
7+
echo "Detected that this script is running in a CI environment, so skipping GitGuardian ggshield"
88
fi

0 commit comments

Comments
 (0)