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
4 changes: 2 additions & 2 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# .github/release.yml

---
changelog:
exclude:
labels:
Expand All @@ -13,4 +13,4 @@ changelog:
- enhancement
- title: Other Changes
labels:
- "*"
- "*"
30 changes: 6 additions & 24 deletions .github/workflows/docker-build-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
name: Docker Build and Publish

on:
# Disabling since our linter thinks that "on" is us attempting to say a truthy value, which isn't the case
on: # yamllint disable-line
push:
branches: ["main"]
# Publish semver tags as releases.
Expand Down Expand Up @@ -57,28 +59,8 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Export release tag
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
run: echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV

- name: Create release
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
uses: actions/github-script@v6
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
try {
const response = await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: process.env.RELEASE_TAG,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: process.env.RELEASE_TAG,
});
core.exportVariable('RELEASE_ID', response.data.id);
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) {
core.setFailed(error.message);
}
generate_release_notes: true
1 change: 1 addition & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# MD013/line-length - Line length
MD013:
# Number of characters
Expand Down
8 changes: 8 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: default

rules:
# 120 chars should be enough, but don't fail if a line is longer
line-length:
max: 120
level: warning
26 changes: 22 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ IMAGE_TAG:=$(shell whoami)-$(shell git describe --always)-dirty
MD_LINT_IMAGE:=ghcr.io/igorshubovych/markdownlint-cli:v0.44.0
DOCKERFILE_LINT_IMAGE:=ghcr.io/hadolint/hadolint:v2.12.0
DIVE_IMAGE:=ghcr.io/wagoodman/dive:v0.13.1
YAML_LINT_IMAGE:=pipelinecomponents/yamllint:0.34.0

IS_TTY := $(shell [ -t 0 ] && echo yes || echo no)
ifeq ($(IS_TTY),yes)
TTY_ARGS := "-it"
else
TTY_ARGS := "-i"
endif


.PHONY: build
build:
docker build -t $(IMAGE_NAME):$(IMAGE_TAG) .
docker run --rm -it \
docker run --rm $(TTY_ARGS) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$(PWD)":"$(PWD)" \
-w "$(PWD)" \
Expand All @@ -25,17 +34,26 @@ build:
MD_FILES:=$(shell find . -name "*.md")
.PHONY: lint_markdown
lint_markdown:
docker run --rm \
docker run --rm $(TTY_ARGS) \
-v "${PWD}":"${PWD}" \
-w "${PWD}" \
$(MD_LINT_IMAGE) $(MD_FILES)

.PHONY: lint_dockerfile
lint_dockerfile:
docker run --rm -i $(DOCKERFILE_LINT_IMAGE) < Dockerfile
docker run --rm -i \
$(DOCKERFILE_LINT_IMAGE) < Dockerfile

.PHONY: lint_yaml
lint_yaml:
docker run --rm $(TTY_ARGS) \
-v "$(PWD)":"$(PWD)" \
-w "$(PWD)" \
$(YAML_LINT_IMAGE) yamllint -c .yamllint.yaml .


# Aliases
.PHONY: lint
lint: lint_dockerfile lint_markdown
lint: lint_dockerfile lint_markdown lint_yaml
.PHONY: ready
ready: lint build