Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b59721f
feat(gha): download + run binary with given dirs
allejo Feb 26, 2026
0d568db
feat(gha): add opt-in commiting functionality
allejo Feb 26, 2026
bf14b8e
feat(gha): add fail-on-diff mode
allejo Feb 26, 2026
eb47028
feat(gha): save JSON representation of each processed module as output
allejo Feb 26, 2026
d490b58
feat(gha): treat fail_on_diff and commit as booleans
allejo Feb 26, 2026
74540ea
docs(gha): update README with new action documentation
allejo Feb 26, 2026
3bab149
feat(gha): support * and ** for directory paths
allejo Feb 27, 2026
3a8db2a
feat(gha): download latest pre-release if no stable
allejo Feb 27, 2026
65a30eb
docs: update actions/checkout version in README
allejo Mar 3, 2026
3336954
fix(gha): address Copilot review feedback
allejo Mar 26, 2026
0e68c54
fix(gha): implement unused commit_branch arg
allejo Mar 27, 2026
18d8f09
feat(gha): add format + linting jobs to workflows
allejo Mar 27, 2026
dc2dff7
chore(gha): address first batch of linting errors
allejo Mar 27, 2026
5c77eca
docs: format README + address linter warnings
allejo Mar 27, 2026
4f6f6b7
fix(gha): don't fail silently on GH API calls
allejo Mar 27, 2026
488bf12
docs: show GH template syntax for token in arg table
allejo Mar 27, 2026
feac1c4
feat(gha): apply PR feedback from Copilot
allejo Mar 27, 2026
8e98cb2
feat(gha): use GH_TOKEN for gh/git operations
allejo Mar 27, 2026
55df454
fix(ci/cd): setup Go before formatting step
allejo Mar 27, 2026
03faae3
feat(gha): enable Bash debug when runner.debug is true
allejo Mar 27, 2026
9e9a271
feat(gha): don't silence gh errors
allejo Mar 27, 2026
13b0969
fix(gha): don't kill workflow when 'gh' command fails
allejo Mar 27, 2026
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
11 changes: 11 additions & 0 deletions .github/super-linter.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FIX_MARKDOWN=true
FIX_YAML_PRETTIER=true
VALIDATE_CHECKOV=true
VALIDATE_GITHUB_ACTIONS=true
VALIDATE_GITHUB_ACTIONS_ZIZMOR=true
VALIDATE_GITLEAKS=true
VALIDATE_GIT_MERGE_CONFLICT_MARKERS=true
VALIDATE_GO=true
VALIDATE_MARKDOWN=true
VALIDATE_YAML=true
VALIDATE_YAML_PRETTIER=true
49 changes: 46 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ name: Continuous Integration

on:
push:
Comment thread
allejo marked this conversation as resolved.
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
go-version: "1.24"

- name: Install dependencies
run: make deps
Expand All @@ -25,3 +28,43 @@ jobs:

- name: Test
run: make test

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

Comment thread
allejo marked this conversation as resolved.
- name: Format code
run: make fmt

- name: Check if code is formatted
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "::error::Code is not formatted. Please run 'make fmt' and commit the changes."
git --no-pager diff
exit 1
fi

lint:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
issues: write
pull-requests: write
statuses: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false

- name: Load super-linter configuration
run: grep -v '^#' .github/super-linter.env >> "$GITHUB_ENV"

- name: Super-linter
uses: super-linter/super-linter@v8.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 15 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: CLI Tool Releases
on:
push:
tags:
- 'v*'
- "v*"

permissions:
contents: read

jobs:
build:
Expand Down Expand Up @@ -35,11 +38,14 @@ jobs:

steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
go-version: "1.24"
cache: false

- name: Install dependencies
run: make deps
Expand Down Expand Up @@ -67,6 +73,8 @@ jobs:

steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- name: Download all artifacts
uses: actions/download-artifact@v6
Expand All @@ -78,11 +86,11 @@ jobs:
VERSION: ${{ github.ref_name }}
run: |
mkdir -p release
cp artifacts/tfdocs-extras-linux-amd64/tfdocs-extras release/tfdocs-extras-${VERSION}-linux-amd64
cp artifacts/tfdocs-extras-linux-arm64/tfdocs-extras release/tfdocs-extras-${VERSION}-linux-arm64
cp artifacts/tfdocs-extras-darwin-amd64/tfdocs-extras release/tfdocs-extras-${VERSION}-darwin-amd64
cp artifacts/tfdocs-extras-darwin-arm64/tfdocs-extras release/tfdocs-extras-${VERSION}-darwin-arm64
cp artifacts/tfdocs-extras-windows-amd64/tfdocs-extras.exe release/tfdocs-extras-${VERSION}-windows-amd64.exe
cp "artifacts/tfdocs-extras-linux-amd64/tfdocs-extras" "release/tfdocs-extras-${VERSION}-linux-amd64"
cp "artifacts/tfdocs-extras-linux-arm64/tfdocs-extras" "release/tfdocs-extras-${VERSION}-linux-arm64"
cp "artifacts/tfdocs-extras-darwin-amd64/tfdocs-extras" "release/tfdocs-extras-${VERSION}-darwin-amd64"
cp "artifacts/tfdocs-extras-darwin-arm64/tfdocs-extras" "release/tfdocs-extras-${VERSION}-darwin-arm64"
cp "artifacts/tfdocs-extras-windows-amd64/tfdocs-extras.exe" "release/tfdocs-extras-${VERSION}-windows-amd64.exe"

- name: Create Release
uses: softprops/action-gh-release@v2
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help build test coverage clean fmt deps
.PHONY: help build test coverage clean fmt deps lint

# Variables
GO := go
Expand All @@ -7,6 +7,7 @@ BINARY_NAME := tfdocs-extras
BIN_DIR := bin
COVERAGE_FILE := coverage.out
COVERAGE_HTML := coverage.html
SUPER_LINTER_VERSION := v8.5.0

# Default target
help:
Expand All @@ -17,6 +18,7 @@ help:
@echo " make clean - Remove build artifacts"
@echo " make fmt - Format code"
@echo " make deps - Download dependencies"
@echo " make lint - Run super-linter locally (fix mode)"
@echo " make all - Build and test"

build:
Expand Down Expand Up @@ -45,3 +47,12 @@ deps:

all: fmt test build
@echo "Build and test completed successfully!"

lint:
@docker run --rm \
-e RUN_LOCAL=true \
-e DEFAULT_BRANCH=main \
-e FIX_MODE=true \
--env-file ".github/super-linter.env" \
-v "$$(pwd)":/tmp/lint \
ghcr.io/super-linter/super-linter:$(SUPER_LINTER_VERSION)
Loading
Loading