Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: .
rev: v1.0.1
rev: v1.0.2
hooks:
- id: cod3rocket
exclude: test/
2 changes: 1 addition & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- id: cod3rocket
name: Cod3Rocket
entry: ghcr.io/cod3rocket/pre-commit-hooks:v1.0.1
entry: ghcr.io/cod3rocket/pre-commit-hooks:v1.0.2
language: docker_image

- id: cod3rocket-dev
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ENV USER=cod3rocket
ENV HOME=/home/$USER
ENV PATH="$PATH:$HOME/.local/bin:$HOME/.local/share/mise/shims"

RUN dnf install -y curl ca-certificates tar freetype dejavu-sans-fonts fontconfig \
RUN dnf install -y curl ca-certificates tar freetype dejavu-sans-fonts fontconfig git \
&& dnf clean all \
&& rm -rf /var/cache/yum \
&& useradd -m -s /bin/bash $USER
Expand All @@ -37,10 +37,10 @@ COPY mise.toml /etc/mise/config.toml

RUN mise trust && mise install --yes && mise reshim

COPY --chown=$USER:$USER package.json bun.lock entrypoint.ts /opt/cod3rocket/pre-commit-hooks/
COPY --chown=$USER:$USER package.json bun.lock main.ts entrypoint.sh /opt/cod3rocket/pre-commit-hooks/

WORKDIR /opt/cod3rocket/pre-commit-hooks

RUN bun i

ENTRYPOINT [ "bun", "run", "entrypoint.ts" ]
ENTRYPOINT [ "/opt/cod3rocket/pre-commit-hooks/entrypoint.sh" ]
5 changes: 4 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ version: "3"

tasks:
build:dev:
cmd: docker buildx build -t ghcr.io/cod3rocket/pre-commit-hooks:dev .
cmd: docker buildx build
--build-arg BUILD_VERSION=dev
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
-t ghcr.io/cod3rocket/pre-commit-hooks:dev .
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

paths=("$@")
novo_paths=()

for path in "${paths[@]}"; do
novo_paths+=("/src/$path")
done

echo "Executa os hooks"
cd /opt/cod3rocket/pre-commit-hooks/
bun run main.ts "${novo_paths[@]}"
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pre-commit-hooks",
"version": "1.0.1",
"module": "entrypoint.ts",
"version": "1.0.2",
"module": "main.ts",
"type": "module",
"private": true,
"devDependencies": {
Expand Down