Skip to content

Commit

Permalink
ci: use remote taskfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaro committed Aug 11, 2024
1 parent e2360c8 commit c2dadf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
echo Running pre-commit hook

# Run pre-commit, this checks if we changed any files and runs the checks.
# The files are then git-added
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
if [ -n "$FILES" ]; then
task format >/dev/null 2>&1
if ! task lint >/dev/null 2>&1; then
if ! task lint --yes >/dev/null 2>&1; then
echo "Error running make lint - please fix before committing"
echo "if this is a mistake you can skip the checks with 'git commit --no-verify'"
exit 1
fi
echo "$FILES" | xargs git add
fi

exit 0
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
workflow_call:
workflow_dispatch:

env:
TASK_X_REMOTE_TASKFILES: 1

jobs:
lint:
name: Lint
Expand All @@ -24,6 +27,7 @@ jobs:
/home/linuxbrew/.linuxbrew/bin/brew install \
actionlint \
check-jsonschema \
fd \
go-task \
jq \
prettier \
Expand All @@ -33,4 +37,4 @@ jobs:
yamllint \
- name: Lint
run: task lint
run: task lint --yes
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ shopt: [globstar]

includes:
lint:
taskfile: .taskfiles/lint.yml
taskfile: https://github.com/nikaro/meta/raw/main/taskfiles/lint.yml
internal: true
format:
taskfile: .taskfiles/format.yml
taskfile: https://github.com/nikaro/meta/raw/main/taskfiles/format.yml
internal: true

tasks:
Expand Down

0 comments on commit c2dadf6

Please sign in to comment.