Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
aee86e8
feat (docs): Add auto generation of license and docs
OliverTrautvetter Oct 14, 2025
4b0ba30
fix: prevent new workflow from doing loops and ignoring merges
OliverTrautvetter Oct 14, 2025
f026b7e
auto(docs): update docs and licenses
OliverTrautvetter Oct 14, 2025
3b694fc
fix: amend last commit with auto-generated changes instead of using s…
OliverTrautvetter Oct 14, 2025
630bfdf
fix: amend last commit with auto-generated changes instead of using s…
OliverTrautvetter Oct 14, 2025
6434e76
fix: add signoff to auto-amend commit in update-docs-and-licenses wor…
OliverTrautvetter Oct 14, 2025
f7b9fe7
docs: Describe service root command, update README (#32)
NautiluX Oct 10, 2025
d5c2d20
feat (docs): Add auto generation of license and docs
OliverTrautvetter Oct 14, 2025
86e49c2
fix: prevent new workflow from doing loops and ignoring merges
OliverTrautvetter Oct 14, 2025
c09a065
auto(docs): update docs and licenses
OliverTrautvetter Oct 14, 2025
4a17380
fix: amend last commit with auto-generated changes instead of using s…
OliverTrautvetter Oct 14, 2025
ba8c5c1
fix: add signoff to auto-amend commit in update-docs-and-licenses wor…
OliverTrautvetter Oct 14, 2025
2dec140
Merge branch 'automate_docs_and_license_generation' of https://github…
OliverTrautvetter Oct 14, 2025
5ee6bf2
fix: amend last commit with auto-generated changes instead of using s…
OliverTrautvetter Oct 14, 2025
b3f17bd
Merge branch 'automate_docs_and_license_generation' of https://github…
OliverTrautvetter Oct 14, 2025
df61193
Merge branch 'automate_docs_and_license_generation' of https://github…
OliverTrautvetter Oct 14, 2025
d20d4b3
Merge branch 'automate_docs_and_license_generation' of https://github…
OliverTrautvetter Oct 14, 2025
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
3 changes: 3 additions & 0 deletions .github/workflows/cli-build_test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Codesphere Inc.
# SPDX-License-Identifier: Apache-2.0

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Codesphere Inc.
# SPDX-License-Identifier: Apache-2.0

name: golangci-lint
on:
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/service-build_test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Codesphere Inc.
# SPDX-License-Identifier: Apache-2.0

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Codesphere Inc.
# SPDX-License-Identifier: Apache-2.0

name: Tag

on:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/update-docs-and-licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) Codesphere Inc.
# SPDX-License-Identifier: Apache-2.0

name: 'Auto-Update Docs & Licenses'

permissions:
contents: write

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main

jobs:
update-files:
# skip runs triggered by the bot's own commit to avoid loops
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# on push to main, use main; on PR, check out the PR head
ref: ${{ github.event.pull_request.head.ref || github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update docs & licenses
run: |
./hack/update-docs-and-licenses.sh

- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
message: "auto(docs): update docs and licenses"
63 changes: 63 additions & 0 deletions hack/update-docs-and-licenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# Copyright (c) Codesphere Inc.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail
IFS=$'\n\t'

here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
root=$(cd "$here/.." && pwd)

echo "Working directory: $root"

cd "$root"

echo "1/2: Generating docs"

if command -v go >/dev/null 2>&1; then
go run ./hack/gendocs/main.go
echo "Docs generated into: $root/docs"
else
echo "ERROR: 'go' binary not found in PATH. Install Go and retry." >&2
exit 2
fi

echo "2/2: Updating licenses"

echo "Checking license tooling: go-licenses + addlicense"

export GOBIN="$(go env GOBIN 2>/dev/null || echo "$HOME/go/bin")"
export PATH="$GOBIN:$PATH"

need_install=()
if ! command -v go-licenses >/dev/null 2>&1; then
need_install+=("github.com/google/go-licenses@latest")
fi
if ! command -v addlicense >/dev/null 2>&1; then
need_install+=("github.com/google/addlicense@latest")
fi

if [ ${#need_install[@]} -ne 0 ]; then
echo "Installing missing tools: ${need_install[*]}"
for pkg in "${need_install[@]}"; do
if command -v go >/dev/null 2>&1; then
go install "$pkg"
else
echo "ERROR: 'go' binary not found; cannot install $pkg" >&2
exit 2
fi
done
fi

echo "Generating NOTICE via go-licenses"
if command -v go-licenses >/dev/null 2>&1; then

if ! go-licenses report --template .NOTICE.template ./... > NOTICE 2> >(grep -v "module .* has empty version, defaults to HEAD" >&2); then
echo "go-licenses report failed" >&2
fi
echo "NOTICE generated/updated"
else
echo "go-licenses not available; skipping NOTICE generation" >&2
fi

echo "Done."
3 changes: 3 additions & 0 deletions internal/portal/api_key.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Codesphere Inc.
// SPDX-License-Identifier: Apache-2.0

package portal

import "time"
Expand Down
3 changes: 1 addition & 2 deletions internal/util/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions internal/util/required_flag.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Codesphere Inc.
// SPDX-License-Identifier: Apache-2.0

package util

import (
Expand Down