diff --git a/.github/scripts/check-module-submodules.sh b/.github/scripts/check-module-submodules.sh new file mode 100644 index 0000000..f5da3ee --- /dev/null +++ b/.github/scripts/check-module-submodules.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +set -euo pipefail + +active_modules=( + "AtlassianPS.Configuration" + "ConfluencePS" + "JiraAgilePS" + "JiraPS" +) + +# Modules without tags can still have an explicit documentation baseline. +no_tag_baselines=( + "JiraAgilePS" +) + +# Keep docs-only exceptions narrow and remove them after the next module release. +docs_only_exceptions=( + "AtlassianPS.Configuration:555e8a3300a12e03b1d9c494a874fe21fe9bbccf" +) + +has_no_tag_baseline() { + local module="$1" + + for baseline in "${no_tag_baselines[@]}"; do + if [[ "$baseline" == "$module" ]]; then + return 0 + fi + done + + return 1 +} + +has_docs_only_exception() { + local module="$1" + local commit="$2" + + for exception in "${docs_only_exceptions[@]}"; do + if [[ "$exception" == "$module:$commit" ]]; then + return 0 + fi + done + + return 1 +} + +errors=0 + +for module in "${active_modules[@]}"; do + path="modules/$module" + + if [[ ! -d "$path/.git" && ! -f "$path/.git" ]]; then + printf '::error file=.gitmodules::%s submodule is not initialized at %s\n' "$module" "$path" + errors=$((errors + 1)) + continue + fi + + git -C "$path" fetch --tags --quiet origin + + if tag=$(git -C "$path" describe --tags --exact-match HEAD 2>/dev/null); then + printf '%s is release-aligned at %s.\n' "$module" "$tag" + continue + fi + + tag_count=$(git -C "$path" tag | wc -l | tr -d ' ') + commit=$(git -C "$path" rev-parse HEAD) + short_commit=$(git -C "$path" rev-parse --short HEAD) + + if [[ "$tag_count" == "0" ]] && has_no_tag_baseline "$module"; then + printf '::notice file=.gitmodules::%s has no tags; treating %s as the documented baseline.\n' "$module" "$short_commit" + continue + fi + + if has_docs_only_exception "$module" "$commit"; then + printf '::notice file=.gitmodules::%s points at docs-only exception %s. Move back to a release tag after the next module release.\n' "$module" "$short_commit" + continue + fi + + if [[ "$tag_count" == "0" ]]; then + printf '::error file=.gitmodules::%s is untagged and has no no-tags baseline exception.\n' "$module" + else + printf '::error file=.gitmodules::%s points at %s, which is not an exact release tag. Use a release tag or add a narrow docs-only exception in this script.\n' "$module" "$short_commit" + fi + + errors=$((errors + 1)) +done + +exit "$errors" diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index b75ce8f..04fe677 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -34,6 +34,9 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v5 + - name: Check module submodules + run: bash .github/scripts/check-module-submodules.sh + - name: Build Jekyll run: bundle exec jekyll build --baseurl "" env: diff --git a/Gemfile b/Gemfile index 7a42359..592b0d7 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,4 @@ source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins gem "webrick", "~> 1.8" +gem "logger", "~> 1.6" diff --git a/_data/index/modules.yml b/_data/index/modules.yml index c7203ec..165e42f 100644 --- a/_data/index/modules.yml +++ b/_data/index/modules.yml @@ -1,7 +1,4 @@ -# projects section data -# - name: BitbucketPS - name: ConfluencePS -# - name: HipChatPS - name: JiraAgilePS - name: JiraPS - name: AtlassianPS.Configuration diff --git a/_data/modules.yml b/_data/modules.yml index 3668f48..d82d584 100644 --- a/_data/modules.yml +++ b/_data/modules.yml @@ -1,24 +1,35 @@ -# - name: BitbucketPS -# description: ToDo -# github: https://github.com/AtlassianPS/BitbucketPS -# path: /module/BitbucketPS - name: ConfluencePS description: A PowerShell module that interacts with Atlassian's Confluence wiki product. github: https://github.com/AtlassianPS/ConfluencePS path: /module/ConfluencePS -# - name: HipChatPS -# description: ToDo -# github: https://github.com/AtlassianPS/HipChatPS -# path: /module/HipChatPS + status: active - name: JiraAgilePS description: PowerShell module to interact with Jira's Agile plugin github: https://github.com/AtlassianPS/JiraAgilePS path: /module/JiraAgilePS + status: active - name: JiraPS description: PowerShell module to interact with Atlassian JIRA github: https://github.com/AtlassianPS/JiraPS path: /module/JiraPS + status: active - name: AtlassianPS.Configuration description: A module for AtlassianPS modules to use for managing connections github: https://github.com/AtlassianPS/AtlassianPS.Configuration path: /module/AtlassianPS.Configuration + status: active +- name: AtlassianPS + description: Legacy metapackage; not an active documentation target. + github: https://github.com/AtlassianPS/AtlassianPS + path: /module/AtlassianPS + status: legacy +- name: BitbucketPS + description: Legacy Bitbucket module; not an active documentation target. + github: https://github.com/AtlassianPS/BitbucketPS + path: /module/BitbucketPS + status: legacy +- name: HipChatPS + description: Legacy HipChat module; not an active documentation target. + github: https://github.com/AtlassianPS/HipChatPS + path: /module/HipChatPS + status: legacy diff --git a/_data/navigation.yml b/_data/navigation.yml index aee100b..d6fa249 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -38,7 +38,9 @@ - Classes - name: JiraAgilePS path: docs/JiraAgilePS - listChilds: true + groups: + - About + - Commands # - name: HipChatPS # path: docs/HipChatPS - name: JiraPS diff --git a/_includes/sidenav.html b/_includes/sidenav.html index f38ab34..f373e41 100644 --- a/_includes/sidenav.html +++ b/_includes/sidenav.html @@ -14,8 +14,13 @@ {% if module.groups %} {% for group in module.groups %} {% capture groupPath %}/{{ module.path }}/{{ group | downcase }}{% endcapture%} + {% if group == "About" %} + {% capture groupLink %}/{{ module.path }}{% endcapture %} + {% else %} + {% capture groupLink %}{{ groupPath }}{% endcapture %} + {% endif %}
- {{group}} + {{group}}