diff --git a/.github/release.yml b/.github/release.yml index b697af9..a1783fd 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,5 +1,5 @@ # .github/release.yml - +--- changelog: exclude: labels: @@ -13,4 +13,4 @@ changelog: - enhancement - title: Other Changes labels: - - "*" \ No newline at end of file + - "*" diff --git a/.github/workflows/docker-build-publish.yaml b/.github/workflows/docker-build-publish.yaml index 083618f..18b73f6 100644 --- a/.github/workflows/docker-build-publish.yaml +++ b/.github/workflows/docker-build-publish.yaml @@ -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. @@ -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 diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 7b4d8aa..e184a9d 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,3 +1,4 @@ +--- # MD013/line-length - Line length MD013: # Number of characters diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..49b4799 --- /dev/null +++ b/.yamllint.yaml @@ -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 diff --git a/makefile b/makefile index ca90727..5ea95ea 100644 --- a/makefile +++ b/makefile @@ -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)" \ @@ -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 \ No newline at end of file