Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ relates to #1234
- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see e.g. [here](https://github.com/stackitcloud/stackit-cli/blob/ef291d1683ca5b0d719ec0a26ecb999a32685117/internal/cmd/ske/cluster/create/create.go#L49-L63))
- [ ] Docs are up-to-date: `make generate-docs`
- [ ] Docs are up-to-date: `make generate-docs` (will be checked by CI)
Comment thread
rubenhoenle marked this conversation as resolved.
Outdated
- [ ] Unit tests got implemented or updated
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
uses: ./.github/actions/build
with:
go-version: ${{ env.GO_VERSION }}

- name: "Ensure docs are up-to-date"
if: ${{ github.event_name == 'pull_request' }}
run: ./scripts/check-docs.sh

- name: Lint
run: make lint

- name: Test
run: make test
21 changes: 21 additions & 0 deletions scripts/check-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# This script is used to ensure for PRs the docs are up-to-date via the CI pipeline
# Usage: ./check-docs.sh
set -eo pipefail

ROOT_DIR=$(git rev-parse --show-toplevel)

before_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}')

# re-generate the docs
go run $ROOT_DIR/scripts/generate.go

after_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}')

if [[ "$before_hash" == "$after_hash" ]]; then
echo "Docs are up-to-date"
else
echo "Changes detected. Docs are *not* up-to-date."
exit 1
fi