From cdb2e14fb98eca23debf28a46b65938d2144bd17 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:25:02 +0200 Subject: [PATCH 01/10] Add yaml linting to validate-workflows --- .github/workflows/validate-workflows.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/validate-workflows.yaml b/.github/workflows/validate-workflows.yaml index f5c2351..c8ff2e0 100644 --- a/.github/workflows/validate-workflows.yaml +++ b/.github/workflows/validate-workflows.yaml @@ -15,6 +15,11 @@ jobs: - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Validate YAML + uses: docker://gsoci.azurecr.io/giantswarm/yamllint:1.0.0 + with: + args: --format=github . + - name: Validate GitHub Actions uses: jazzsequence/github-action-validator@843ac61ce962184aa316e582398e99c744e4215f # v1.0.0 with: From 32c80aa4ff687c4ee883ac63646faf4302cf2d29 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:36:05 +0200 Subject: [PATCH 02/10] Create .yamllint.yaml --- .yamllint.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .yamllint.yaml diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..0bd79d6 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,6 @@ +--- +extends: default +rules: + line-length: + max: 120 + document-start: disable From f56580e97c94e68da56b9d54e047fd3860e84f0d Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:40:08 +0200 Subject: [PATCH 03/10] Extend max line length --- .yamllint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamllint.yaml b/.yamllint.yaml index 0bd79d6..7bbce9d 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -2,5 +2,5 @@ extends: default rules: line-length: - max: 120 + max: 200 document-start: disable From 5513c7c38ec9f3162988e8ca407018bc9af1ba5a Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:40:27 +0200 Subject: [PATCH 04/10] Fix errors in fix-vulnerabilities --- .github/workflows/fix-vulnerabilities.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fix-vulnerabilities.yaml b/.github/workflows/fix-vulnerabilities.yaml index 8fa37fd..5b0f2b4 100644 --- a/.github/workflows/fix-vulnerabilities.yaml +++ b/.github/workflows/fix-vulnerabilities.yaml @@ -8,12 +8,12 @@ on: required: true type: string secrets: - HERALD_APP_ID: - description: App ID for create-github-app-token - required: true - HERALD_APP_KEY: - description: Private key for create-github-app-token - required: true + HERALD_APP_ID: + description: App ID for create-github-app-token + required: true + HERALD_APP_KEY: + description: Private key for create-github-app-token + required: true jobs: gather_facts: @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-24.04 outputs: branch: ${{ steps.gather_facts.outputs.branch }} - skip : ${{ steps.gather_facts.outputs.skip }} + skip: ${{ steps.gather_facts.outputs.skip }} steps: - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -81,7 +81,7 @@ jobs: - name: Run nancy-fixer fix uses: docker://gsoci.azurecr.io/giantswarm/nancy-fixer:0.5.1 timeout-minutes: 20 - + - name: Set up git identity run: | git config --local user.email "149080493+heraldbot[bot]@users.noreply.github.com" From b524a6503af4cdf4ca2478abcba75095f8d8c728 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:42:37 +0200 Subject: [PATCH 05/10] Update go-coverage.yaml --- .github/workflows/go-coverage.yaml | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/go-coverage.yaml b/.github/workflows/go-coverage.yaml index 2b6909c..0011968 100644 --- a/.github/workflows/go-coverage.yaml +++ b/.github/workflows/go-coverage.yaml @@ -22,22 +22,22 @@ jobs: # Needed to create a comment on the commit contents: write steps: - - name: Clone repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - # default fetch-depth is insufficent to find previous coverage notes - fetch-depth: 10 + - name: Clone repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + # default fetch-depth is insufficent to find previous coverage notes + fetch-depth: 10 - - name: Create coverage report - uses: gwatts/go-coverage-action@2845595538a59d63d1bf55f109c14e104c6f7cb3 # v2.0.0 - id: coverage - env: - GITHUB_TOKEN: "${{ secrets.token }}" - with: - # Optional coverage threshold - # use fail-coverage to determine what should happen below this threshold - #coverage-threshold: 80 - fail-coverage: 1 + - name: Create coverage report + uses: gwatts/go-coverage-action@2845595538a59d63d1bf55f109c14e104c6f7cb3 # v2.0.0 + id: coverage + env: + GITHUB_TOKEN: "${{ secrets.token }}" + with: + # Optional coverage threshold + # use fail-coverage to determine what should happen below this threshold + #coverage-threshold: 80 + fail-coverage: 1 - # collect coverage for all packages beyond the one under test - cover-pkg: ./... + # collect coverage for all packages beyond the one under test + cover-pkg: ./... From d53d5b3c305157f33817d4f1129152f4906b2f5b Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:43:46 +0200 Subject: [PATCH 06/10] Update publish-techdocs.yaml --- .github/workflows/publish-techdocs.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-techdocs.yaml b/.github/workflows/publish-techdocs.yaml index e27295e..05c1968 100644 --- a/.github/workflows/publish-techdocs.yaml +++ b/.github/workflows/publish-techdocs.yaml @@ -43,18 +43,18 @@ jobs: ./node_modules restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- - + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} name: List the state of node modules continue-on-error: true run: npm list - + - name: Install techdocs-cli run: npm install @techdocs/cli - name: Show techdocs-cli version run: ./node_modules/@techdocs/cli/bin/techdocs-cli --version - + - name: Generate mkdocs configuration id: generate_mkdocs_config shell: python {0} @@ -132,22 +132,21 @@ jobs: with open("mkdocs.yml", "w") as f: f.write(output) - + with open(os.environ["GITHUB_OUTPUT"], "a") as f: f.write("content_found=true\n") - - if: ${{ steps.generate_mkdocs_config.outputs.content_found == 'true' }} name: Generate documentation run: | mkdir $GITHUB_WORKSPACE/tmp-docs-output $GITHUB_WORKSPACE/node_modules/@techdocs/cli/bin/techdocs-cli \ generate --verbose --output-dir=$GITHUB_WORKSPACE/tmp-docs-output - + - if: ${{ steps.generate_mkdocs_config.outputs.content_found == 'true' }} name: Show output run: ls -la $GITHUB_WORKSPACE/tmp-docs-output - + - if: ${{ steps.generate_mkdocs_config.outputs.content_found == 'true' }} name: Publish env: From 583189441172d1002691a650d7db05b1d159db0a Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:44:37 +0200 Subject: [PATCH 07/10] Update create-release-pr.yaml --- .github/workflows/create-release-pr.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create-release-pr.yaml b/.github/workflows/create-release-pr.yaml index f2e8f29..bafa0bb 100644 --- a/.github/workflows/create-release-pr.yaml +++ b/.github/workflows/create-release-pr.yaml @@ -26,12 +26,12 @@ jobs: name: Gather facts runs-on: ubuntu-24.04 outputs: - repo_name: ${{ steps.gather_facts.outputs.repo_name }} - branch: ${{ steps.gather_facts.outputs.branch }} - base: ${{ steps.gather_facts.outputs.base }} + repo_name: ${{ steps.gather_facts.outputs.repo_name }} + branch: ${{ steps.gather_facts.outputs.branch }} + base: ${{ steps.gather_facts.outputs.base }} needs_major_bump: ${{ steps.gather_facts.outputs.needs_major_bump }} - skip: ${{ steps.pr_exists.outputs.skip }} - version: ${{ steps.gather_facts.outputs.version }} + skip: ${{ steps.pr_exists.outputs.skip }} + version: ${{ steps.gather_facts.outputs.version }} steps: - name: Gather facts id: gather_facts From 7df2d66c785fbc79cc2d21ea4d0d291d8ebeff80 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:46:01 +0200 Subject: [PATCH 08/10] Update validate-changelog.yaml --- .github/workflows/validate-changelog.yaml | 46 +++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/validate-changelog.yaml b/.github/workflows/validate-changelog.yaml index 0c65b96..baf2140 100644 --- a/.github/workflows/validate-changelog.yaml +++ b/.github/workflows/validate-changelog.yaml @@ -27,9 +27,9 @@ jobs: run: | branch_name="$BRANCH_NAME" echo "Branch name: $branch_name" - + version="" - + # Use case statement for more reliable pattern matching case "$branch_name" in *"#release#v"*) @@ -47,12 +47,12 @@ jobs: # Extract bump type and get version from changelog bump_type=$(echo "$branch_name" | sed -E 's/.*#release#(major|minor|patch).*/\1/') echo "🔍 Detected semantic version branch ($bump_type), extracting version from changelog..." - + if [ ! -f "CHANGELOG.md" ]; then echo "::error::CHANGELOG.md not found" exit 1 fi - + # Get the first version entry (should be the newest one that architect created) version=$(grep -E "^## \[[0-9]+\.[0-9]+\.[0-9]+\]" CHANGELOG.md | head -1 | sed -E 's/^## \[([0-9]+\.[0-9]+\.[0-9]+)\].*/\1/') @@ -63,10 +63,10 @@ jobs: grep -E "^## \[" CHANGELOG.md | head -5 || echo "No version entries found" exit 1 fi - + echo "Extracted version from changelog for $bump_type release: $version" ;; - + *) echo "::error::Could not extract version from branch name: $branch_name" echo "::error::Expected patterns:" @@ -81,12 +81,12 @@ jobs: exit 1 ;; esac - + if [ -z "$version" ]; then echo "::error::Version extraction failed - version is empty" exit 1 fi - + echo "Final extracted version: $version" echo "version=$version" >> $GITHUB_OUTPUT @@ -94,34 +94,34 @@ jobs: run: | version="${{ steps.extract_version.outputs.version }}" changelog_file="CHANGELOG.md" - + echo "Validating changelog content for version $version..." echo "Checking file: $changelog_file" - + # Check if CHANGELOG.md exists if [ ! -f "$changelog_file" ]; then echo "::error::No $changelog_file found in repository" exit 1 fi - + # Extract the content between the new version and the next version changelog_section=$(awk " /^## \[$version\]/ { found=1; print; next } found && /^## \[/ && !/^## \[$version\]/ { found=0 } found { print } " "$changelog_file") - + if [ -z "$changelog_section" ]; then echo "::error::No section found for version $version in changelog" echo "::error::Expected format: ## [$version] - YYYY-MM-DD" exit 1 fi - + echo "Found changelog section for version $version" - + # Check if there are any ### headers (Added, Changed, Deprecated, Removed, Fixed, Security) subsection_count=$(echo "$changelog_section" | grep -c "^### " || true) - + if [ "$subsection_count" -eq 0 ]; then echo "::error title=Empty Changelog::No changelog content found for version $version" echo "::error::The release appears to have an empty changelog." @@ -142,7 +142,7 @@ jobs: echo "Sections found:" echo "$changelog_section" | grep "^### " | sed 's/^/ /' fi - + - name: Add PR comment if validation fails if: failure() uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 7.0.1 @@ -150,9 +150,9 @@ jobs: script: | const version = '${{ steps.extract_version.outputs.version }}'; const body = `## 📝 Changelog Validation Failed - + The changelog for version **${version}** appears to be empty. - + Please add content under appropriate sections like: - \`### Added\` - for new features - \`### Changed\` - for changes in existing functionality @@ -160,19 +160,19 @@ jobs: - \`### Removed\` - for now removed features - \`### Deprecated\` - for soon-to-be removed features - \`### Security\` - in case of vulnerabilities - + **Example:** \`\`\`markdown ## [${version}] - ${new Date().toISOString().split('T')[0]} - + ### Changed - + - Updated dependency X to version Y - Improved error handling in module Z \`\`\` - + This check will pass once you add proper changelog content.`; - + github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, From 5756e354bdfab58e138a6fb95e3f316bd8b3c580 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:47:53 +0200 Subject: [PATCH 09/10] Update validate-changelog.yaml --- .github/workflows/validate-changelog.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate-changelog.yaml b/.github/workflows/validate-changelog.yaml index baf2140..96d898e 100644 --- a/.github/workflows/validate-changelog.yaml +++ b/.github/workflows/validate-changelog.yaml @@ -42,7 +42,7 @@ jobs: exit 1 fi ;; - + *"#release#major"|*"#release#minor"|*"#release#patch") # Extract bump type and get version from changelog bump_type=$(echo "$branch_name" | sed -E 's/.*#release#(major|minor|patch).*/\1/') @@ -55,7 +55,7 @@ jobs: # Get the first version entry (should be the newest one that architect created) version=$(grep -E "^## \[[0-9]+\.[0-9]+\.[0-9]+\]" CHANGELOG.md | head -1 | sed -E 's/^## \[([0-9]+\.[0-9]+\.[0-9]+)\].*/\1/') - + if [ -z "$version" ]; then echo "::error::Could not find version in CHANGELOG.md" echo "::error::Expected to find a line like: ## [X.Y.Z] - YYYY-MM-DD" @@ -72,7 +72,7 @@ jobs: echo "::error::Expected patterns:" echo " - main#release#v1.2.3" echo " - main#release#major" - echo " - main#release#minor" + echo " - main#release#minor" echo " - main#release#patch" echo " - master#release#v1.2.3" echo " - master#release#major|minor|patch" @@ -89,7 +89,7 @@ jobs: echo "Final extracted version: $version" echo "version=$version" >> $GITHUB_OUTPUT - + - name: Validate changelog content run: | version="${{ steps.extract_version.outputs.version }}" @@ -128,7 +128,7 @@ jobs: echo "" echo "Please add content under appropriate sections like:" echo " ### Added - for new features" - echo " ### Changed - for changes in existing functionality" + echo " ### Changed - for changes in existing functionality" echo " ### Fixed - for any bug fixes" echo " ### Removed - for now removed features" echo " ### Deprecated - for soon-to-be removed features" From 913b6e5371d7ba6857cf782df241f160f794cdd7 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 15 Aug 2025 11:48:40 +0200 Subject: [PATCH 10/10] Update go-coverage.yaml --- .github/workflows/go-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-coverage.yaml b/.github/workflows/go-coverage.yaml index 0011968..5820f28 100644 --- a/.github/workflows/go-coverage.yaml +++ b/.github/workflows/go-coverage.yaml @@ -32,7 +32,7 @@ jobs: uses: gwatts/go-coverage-action@2845595538a59d63d1bf55f109c14e104c6f7cb3 # v2.0.0 id: coverage env: - GITHUB_TOKEN: "${{ secrets.token }}" + GITHUB_TOKEN: "${{ secrets.token }}" with: # Optional coverage threshold # use fail-coverage to determine what should happen below this threshold