Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 1 addition & 3 deletions .github/scripts/check-module-submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ no_tag_baselines=(
)

# Keep docs-only exceptions narrow and remove them after the next module release.
docs_only_exceptions=(
"AtlassianPS.Configuration:555e8a3300a12e03b1d9c494a874fe21fe9bbccf"
)
docs_only_exceptions=()

has_no_tag_baseline() {
local module="$1"
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,30 @@ on:
branches: [master]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
permissions:
contents: read
pages: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
submodules: recursive

- name: Setup Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3"
bundler-cache: true

- name: Setup Pages
uses: actions/configure-pages@v6
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6

- name: Check module submodules
run: bash .github/scripts/check-module-submodules.sh
Expand All @@ -44,10 +42,13 @@ jobs:

- name: Upload artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v5
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5

deploy:
if: github.ref == 'refs/heads/master'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -56,4 +57,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5
54 changes: 47 additions & 7 deletions .github/workflows/update-submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ on:
required: true
type: string

permissions:
contents: read

concurrency:
group: update-submodule-${{ github.event.client_payload.module || inputs.module }}
cancel-in-progress: true

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
submodules: recursive
token: ${{ secrets.PAT_TOKEN }}
Expand All @@ -31,30 +38,63 @@ jobs:

- name: Update submodule
id: update
env:
MODULE: ${{ github.event.client_payload.module || inputs.module }}
VERSION: ${{ github.event.client_payload.version || inputs.version }}
run: |
MODULE="${{ github.event.client_payload.module || inputs.module }}"
VERSION="${{ github.event.client_payload.version || inputs.version }}"
case "$MODULE" in
AtlassianPS.Configuration|ConfluencePS|JiraAgilePS|JiraPS) ;;
*)
echo "::error::Unsupported module: $MODULE"
exit 1
;;
esac

echo "module=$MODULE" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"


current_commits=("$(git rev-parse "HEAD:modules/$MODULE")")
rolling_branch="update-$MODULE"
rolling_ref="refs/remotes/origin/$rolling_branch"

if git ls-remote --exit-code --heads origin "$rolling_branch" >/dev/null; then
git fetch --no-tags origin "refs/heads/$rolling_branch:$rolling_ref"
current_commits+=("$(git rev-parse "$rolling_ref:modules/$MODULE")")
fi

cd "modules/$MODULE"
git fetch origin --tags
tag_ref="refs/tags/$VERSION"
if ! git show-ref --verify --quiet "$tag_ref"; then
echo "::error::Release tag $VERSION does not exist for $MODULE."
exit 1
fi
target_commit=$(git rev-parse --verify "$tag_ref^{commit}")

for current_commit in "${current_commits[@]}"; do
if ! git merge-base --is-ancestor "$current_commit" "$target_commit"; then
echo "::error::Refusing to replace a current $MODULE release with older or unrelated tag $VERSION."
exit 1
fi
done

# The runner checkout may normalize tracked files differently from the
# submodule commit. The worktree is disposable; always select the
# released tag instead of treating those generated changes as user work.
git checkout --force "$VERSION"
git checkout --force "$target_commit"
cd ../..
git add "modules/$MODULE"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
with:
token: ${{ secrets.PAT_TOKEN }}
add-paths: "modules/${{ steps.update.outputs.module }}"
commit-message: "Update ${{ steps.update.outputs.module }} to ${{ steps.update.outputs.version }}"
title: "Update ${{ steps.update.outputs.module }} to ${{ steps.update.outputs.version }}"
body: |
Automated update of ${{ steps.update.outputs.module }} submodule to ${{ steps.update.outputs.version }}.

Triggered by: ${{ github.event_name }}
branch: "update-${{ steps.update.outputs.module }}-${{ steps.update.outputs.version }}"
branch: "update-${{ steps.update.outputs.module }}"
delete-branch: true
2 changes: 2 additions & 0 deletions docs/Contributing/module-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The public documentation under `/docs/<Module>/` should describe the module vers

The website consumes module documentation through Git submodules in `modules/`.
For normal updates, each module submodule should point at the latest released module tag.
Automated releases reuse one `update-<Module>` branch and pull request per module.
A later release refreshes that pull request instead of opening a version-specific stack.

This keeps cmdlet documentation, examples, parameters, and behavior notes aligned with the package users get from `Install-Module`.
The website must not publish documentation from a module branch that contains unreleased or breaking changes as the main module documentation.
Expand Down
2 changes: 1 addition & 1 deletion modules/AtlassianPS.Configuration
Submodule AtlassianPS.Configuration updated 58 files
+8 −0 .github/PULL_REQUEST_TEMPLATE.md
+9 −129 .github/workflows/ci.yml
+3 −1 .github/workflows/continuous_release.yml
+1 −1 .github/workflows/copilot-setup-steps.yml
+2 −2 .github/workflows/release_intent.yml
+1 −0 AGENTS.md
+42 −10 AtlassianPS.Configuration.build.ps1
+2 −2 AtlassianPS.Configuration/AtlassianPS.Configuration.psd1
+12 −0 CHANGELOG.md
+1 −1 Tests/AtlassianPS.Configuration.Tests.ps1
+1 −1 Tests/Build.Tests.ps1
+1 −1 Tests/Classes/AtlassianPS.MessageStyle.Unit.Tests.ps1
+1 −1 Tests/Classes/AtlassianPS.ServerData.Unit.Tests.ps1
+1 −1 Tests/Enumerations/AtlassianPS.ServerType.Unit.Tests.ps1
+1 −1 Tests/Examples.Tests.ps1
+1 −1 Tests/Functions/.template.ps1
+1 −1 Tests/Functions/Add-ServerConfiguration.Unit.Tests.ps1
+1 −1 Tests/Functions/ConvertFrom-QueryString.Unit.Tests.ps1
+1 −1 Tests/Functions/ConvertFrom-URLEncoded.Unit.Tests.ps1
+1 −1 Tests/Functions/ConvertTo-Hashtable.Unit.Tests.ps1
+1 −1 Tests/Functions/ConvertTo-QueryString.Unit.Tests.ps1
+1 −1 Tests/Functions/ConvertTo-URLEncoded.Unit.Tests.ps1
+1 −1 Tests/Functions/Format-MessageStyle.Unit.Tests.ps1
+1 −1 Tests/Functions/Get-BreadCrumb.Unit.Tests.ps1
+1 −1 Tests/Functions/Get-Configuration.Unit.Tests.ps1
+1 −1 Tests/Functions/Get-ServerConfiguration.Unit.Tests.ps1
+1 −1 Tests/Functions/Import-HttpUtility.Unit.Tests.ps1
+1 −1 Tests/Functions/Import-MqcnAlias.Unit.Tests.ps1
+1 −1 Tests/Functions/Invoke-WebRequest.Unit.Tests.ps1
+1 −1 Tests/Functions/Join-Hashtable.Unit.Tests.ps1
+1 −1 Tests/Functions/New-ErrorRecord.Unit.Tests.ps1
+1 −1 Tests/Functions/Remove-Configuration.Unit.Tests.ps1
+1 −1 Tests/Functions/Remove-ServerConfiguration.Unit.Tests.ps1
+1 −1 Tests/Functions/Resolve-DefaultParameterValue.Unit.Tests.ps1
+1 −1 Tests/Functions/Resolve-FilePath.Unit.Tests.ps1
+1 −1 Tests/Functions/Resolve-FullPath.Unit.Tests.ps1
+1 −1 Tests/Functions/Save-Configuration.Unit.Tests.ps1
+1 −1 Tests/Functions/Set-Configuration.Unit.Tests.ps1
+1 −1 Tests/Functions/Set-ServerConfiguration.Unit.Tests.ps1
+1 −1 Tests/Functions/ThrowError.Unit.Tests.ps1
+1 −1 Tests/Functions/Write-DebugMessage.Unit.Tests.ps1
+1 −1 Tests/Functions/Write-NonTerminatingError.Unit.Tests.ps1
+1 −1 Tests/Functions/Write-TerminatingError.Unit.Tests.ps1
+1 −1 Tests/Functions/Write-Verbose.Unit.Tests.ps1
+1 −1 Tests/Functions/Write-VerboseMessage.Unit.Tests.ps1
+1 −1 Tests/Functions/WriteError.Unit.Tests.ps1
+13 −7 Tests/GitHubActions.Unit.Tests.ps1
+8 −2 Tests/Help.Tests.ps1
+1 −1 Tests/PSScriptAnalyzer.Tests.ps1
+6 −2 Tests/Project.Tests.ps1
+1 −1 Tests/Style.Tests.ps1
+1 −1 Tests/TestTools.Tests.ps1
+0 −345 Tests/Tools/SetupScript.Unit.Tests.ps1
+17 −6 Tests/Tools/StandardsVersionConsistency.Unit.Tests.ps1
+0 −285 Tests/Tools/UpdateDependenciesScript.Unit.Tests.ps1
+4 −4 Tools/build.requirements.psd1
+22 −0 Tools/setup.ps1
+0 −99 Tools/update.dependencies.ps1