Skip to content

Commit

Permalink
✨ Try running a real hook in GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahElliott committed Oct 20, 2023
1 parent 2b5c73c commit adac7b5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .capt/share.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Why is there no shellcheck? Doesn't seem to work well for too many things with Zsh.
pre_commit=(
'hithere: hello $CAPT_FILES_CHANGED'
'doclint(md|mkd): mdl $CAPT_FILES_CHANGED' # redundant with markdownlint but good for testing
markdownlint
# -markdownlint
Expand All @@ -12,3 +13,5 @@ pre_commit=(
commit_msg=( msglint )

post_commit=( colorquote )

integration=( colorquote 'hi: hello' )
6 changes: 3 additions & 3 deletions .github/workflows/zsh-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
run: |
# print "in zsh, name, version: $ZSH_NAME, $ZSH_VERSION"
which zsh || echo "No which zsh"
ls -la /usr/bin/zsh || echo "No zsh at /usr/bin"
ls -la /bin/zsh || echo "No zsh at /bin/zsh"
command -v zsh || echo "No command zsh"
pwd
ls
tree
./capt help
ls -la /usr/bin/zsh || echo "No zsh at /usr/bin"
ls -la /bin/zsh || echo "No zsh at /bin/zsh"
./capt pre-commit
# - name: Run a zsh script as proof
# # run: .github/bin/zsh_proof.sh
# run: tree
Expand Down
2 changes: 1 addition & 1 deletion capt
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ setup_changes() {
run_scripts () {
# FIXME maybe all the vars (CAPT_FILES_CHANGED etc) should be local since getting reset on every call?
# TODO check for existence of specified hook and print meaningful message if no/empty hook
if [[ -z $@ ]]; then aye "No hooks to be run."; return; fi
if [[ -z $@ ]]; then aye "No triggers to be run."; return; fi
# Print out all the scripts about to be run
executors=()
for line in $@; do
Expand Down
6 changes: 6 additions & 0 deletions hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /bin/zsh

# Trivial hello world echo test of args
# Useful for testing args, capt vars, etc, as a basic trigger

print hello: $@

0 comments on commit adac7b5

Please sign in to comment.