Skip to content

Commit 5875f6a

Browse files
authored
🎣 [just] add pre-pr hook (#32)
* 🎣 [just] add pre-pr hook * add and include .just/pr-hook.just * fix conditional but this PR is not the test that I hoped for * note that exit is just there to verify once, in next PR
1 parent 4dfa9fc commit 5875f6a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.just/gh-process.just

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# git/gh process justfile
22

3-
# TODO: merge with hugo fork of this somehow
4-
53
# some useful variables
64
release_branch := "main"
75

@@ -18,6 +16,12 @@ pr: _has_commits && pr_checks
1816
#!/usr/bin/env bash
1917
set -euxo pipefail # strict mode
2018

19+
# handle optional pre-pr hook (for things like hugo)
20+
if [[ -e ".just/pr-hook.just" ]]; then
21+
# _pr-hook is hidden because we think it is internal
22+
just _pr-hook
23+
fi
24+
2125
git stp
2226
git pushup
2327

.just/pr-hook.just

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# .just/pr-hook.just
2+
3+
# called from pr recipe in .just/gh-process.just
4+
5+
# run this before creating a PR
6+
_pr-hook:
7+
exit 1 # TODO: remove in next PR after verification
8+
echo "{{BLUE}}placeholder{{NORMAL}}"

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import? '.just/compliance.just'
44
import? '.just/gh-process.just'
5+
import? '.just/pr-hook.just'
56

67
# list recipes (default works without naming it)
78
[group('example')]

0 commit comments

Comments
 (0)