Skip to content

Commit 34e3576

Browse files
committed
fix: add pre-commit yamlfmt and hooks
1 parent 59cd9b2 commit 34e3576

File tree

7 files changed

+19
-20
lines changed

7 files changed

+19
-20
lines changed
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,34 @@
1-
21
name: Publish Docker image
3-
42
on:
53
release:
64
types: [published]
7-
85
env:
96
REGISTRY: ghcr.io
107
IMAGE_NAME: ${{ github.repository }}
11-
128
jobs:
139
build-and-push-image:
1410
runs-on: ubuntu-latest
1511
permissions:
1612
contents: read
1713
packages: write
18-
1914
steps:
2015
- name: Checkout repository
2116
uses: actions/checkout@v3
22-
2317
- name: Log in to the Container registry
2418
uses: docker/login-action@v2
2519
with:
2620
registry: ${{ env.REGISTRY }}
2721
username: ${{ github.actor }}
2822
password: ${{ secrets.GITHUB_TOKEN }}
29-
3023
- name: Extract metadata (tags, labels) for Docker
3124
id: meta
3225
uses: docker/metadata-action@v4
3326
with:
3427
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35-
3628
- name: Build and push Docker image
3729
uses: docker/build-push-action@v3
3830
with:
3931
context: .
4032
push: true
4133
tags: ${{ steps.meta.outputs.tags }}
42-
labels: ${{ steps.meta.outputs.labels }}
34+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
21
name: Test Docker image build
3-
42
on:
53
pull_request:
64
push:
75
branches:
86
- main
9-
107
env:
118
REGISTRY: ghcr.io
129
IMAGE_NAME: ${{ github.repository }}
13-
1410
jobs:
1511
build-image:
1612
runs-on: ubuntu-latest
@@ -28,4 +24,4 @@ jobs:
2824
context: .
2925
push: false
3026
tags: ${{ steps.meta.outputs.tags }}
31-
labels: ${{ steps.meta.outputs.labels }}
27+
labels: ${{ steps.meta.outputs.labels }}

.pre-commit-config.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
repos:
22
- repo: https://github.com/compilerla/conventional-pre-commit
3-
rev: v1.2.0
3+
rev: v4.2.0
44
hooks:
55
- id: conventional-pre-commit
66
stages:
77
- commit-msg
8-
args: ["build", "bump", "chore", "ci", "docs","feat", "fix", "perf", "refactor", "revert", "style", "test"]
8+
args: ["build", "bump", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test"]
9+
- repo: https://github.com/google/yamlfmt
10+
rev: v0.14.0
11+
hooks:
12+
- id: yamlfmt
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v5.0.0
15+
hooks:
16+
- id: end-of-file-fixer
17+
- id: trailing-whitespace

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ RUN mkdir bin && \
5252
ln -s /home/iac-executor/.tgenv/bin/* /home/iac-executor/bin && \
5353
./bin/tfenv --version && ./bin/tgenv --version
5454

55-
ENTRYPOINT ["/bin/bash"]
55+
ENTRYPOINT ["/bin/bash"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ This repository includes a image that include all needed tools for managing clou
1010
- sops
1111
- tfenv
1212
- tflint
13-
- tgenv
13+
- tgenv

cz.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
commitizen:
32
annotated_tag: true
43
name: cz_conventional_commits

makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ default: build
33
init:
44
pre-commit install
55

6+
validate:
7+
pre-commit run -a
8+
69
build:
710
docker build . -t terraform-pipeline-image:local
811

@@ -11,4 +14,4 @@ release:
1114
git push
1215
git push --tags
1316

14-
.PHONY: default init build release
17+
.PHONY: default init validate build release

0 commit comments

Comments
 (0)