Skip to content
Open
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
31 changes: 11 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@064643a6dfc2fbc00d332fc0b950375dbf87a291
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@9a9367e22847bd24f86208ed2d98d207b0e2a3b3 # v0.1.6

- run: Invoke-Build -Task Lint
shell: pwsh
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@064643a6dfc2fbc00d332fc0b950375dbf87a291
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@9a9367e22847bd24f86208ed2d98d207b0e2a3b3 # v0.1.6

- run: Invoke-Build -Task Clean, Build
shell: pwsh
Expand All @@ -66,7 +66,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@064643a6dfc2fbc00d332fc0b950375dbf87a291
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@9a9367e22847bd24f86208ed2d98d207b0e2a3b3 # v0.1.6
with:
ps-version: "5"
# Setup is run below in the powershell (PS 5.1) shell instead of pwsh,
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
- { os: macos-latest, name: "macOS" }
steps:
- uses: actions/checkout@v6
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@064643a6dfc2fbc00d332fc0b950375dbf87a291
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@9a9367e22847bd24f86208ed2d98d207b0e2a3b3 # v0.1.6

- uses: actions/download-artifact@v8
with:
Expand All @@ -129,9 +129,9 @@ jobs:
# Skip on fork PRs and Dependabot PRs: the shared cloud PAT secret is not exposed
# in those contexts and the smoke run would fail. The ci-required
# aggregator below treats skipped jobs as a pass, so fork PRs still get
# a green CI Result. First-party PRs and pushes to master gate on the
# smoke result, which in turn gates release.yml's artifact download
# (workflow_conclusion: success).
# a green CI Result. First-party PRs and pushes to master require smoke
# credentials and a successful smoke run, which in turn gates release.yml's
# artifact download (workflow_conclusion: success).
if: github.event_name != 'pull_request' ||
(github.event.pull_request.head.repo.full_name == github.repository &&
github.actor != 'dependabot[bot]')
Expand All @@ -141,35 +141,26 @@ jobs:
WikiPass: ${{ secrets.ATLASSIAN_CLOUD_PAT }}
steps:
- uses: actions/checkout@v6
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@064643a6dfc2fbc00d332fc0b950375dbf87a291
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@9a9367e22847bd24f86208ed2d98d207b0e2a3b3 # v0.1.6

- name: Detect smoke secret configuration
id: smoke_secrets
- name: Validate smoke secret configuration
run: |
$hasSecrets = -not (
[string]::IsNullOrWhiteSpace($env:WikiURI) -or
[string]::IsNullOrWhiteSpace($env:WikiUser) -or
[string]::IsNullOrWhiteSpace($env:WikiPass)
)
"has_secrets=$($hasSecrets.ToString().ToLowerInvariant())" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8

if (
[string]::IsNullOrWhiteSpace($env:WikiURI) -or
[string]::IsNullOrWhiteSpace($env:WikiUser) -or
[string]::IsNullOrWhiteSpace($env:WikiPass)
) {
Write-Warning "Skipping smoke tests because WikiURI, WikiUser, or WikiPass is not configured."
throw "Smoke tests require WikiURI, WikiUser, and WikiPass in first-party runs."
}
shell: pwsh

- name: Run smoke integration tests
if: steps.smoke_secrets.outputs.has_secrets == 'true'
run: |
Invoke-Build -Task TestIntegration -Tag "Cloud"
shell: pwsh

- name: Upload integration test results
if: always() && steps.smoke_secrets.outputs.has_secrets == 'true'
if: always()
uses: actions/upload-artifact@v7
with:
name: Smoke-Tests
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,24 @@ jobs:
path: ./Release/
if_no_artifact_found: fail

- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@v0.1.2
- uses: AtlassianPS/AtlassianPS.Standards/.github/actions/setup-powershell@9a9367e22847bd24f86208ed2d98d207b0e2a3b3 # v0.1.6

- name: Publish to PowerShell Gallery
- run: Invoke-Build -Task Publish -VersionToPublish ${{ steps.release_ref.outputs.release_tag }}
-PSGalleryAPIKey ${{ secrets.PSGALLERY_API_KEY }}
shell: pwsh
run: |
Import-Module AtlassianPS.Standards -RequiredVersion 0.1.2 -ErrorAction Stop
Publish-AtlassianPSModuleRelease -BuildOutputPath ./Release -ModuleName ConfluencePS -ApiKey ${{ secrets.PSGALLERY_API_KEY }}

- name: Package release zip
shell: pwsh
run: |
Import-Module AtlassianPS.Standards -RequiredVersion 0.1.2 -ErrorAction Stop
$null = New-AtlassianPSModulePackage -BuildOutputPath ./Release -ModuleName ConfluencePS
- name: Cherry pick CHANGELOG.md
id: changelog
uses: MatteoCampinoti94/changelog-to-release@v1.0.6
with:
version-name: ${{ steps.release_ref.outputs.release_tag }}
configuration: ./.github/changelog.configuration.json
if: ${{ hashFiles('CHANGELOG.md') != '' }}

- name: Create Release and Upload Asset
uses: softprops/action-gh-release@v3
with:
body: ${{ steps.changelog.outputs.body }}
tag_name: ${{ steps.release_ref.outputs.release_tag }}
name: ${{ steps.release_ref.outputs.release_tag }}
files: ./Release/ConfluencePS.zip
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Migrated `Tools/setup.ps1` and `Tools/update.dependencies.ps1` to shared `AtlassianPS.Standards` bootstrap/update commands with deterministic standards-version resolution from `Tools/build.requirements.psd1`.
- Replaced legacy PSDepend hashtable dependencies with pinned array requirements and aligned workflow setup action usage to the pinned standards action release.
- Aligned release workflow setup/import steps to `AtlassianPS.Standards` `0.1.6`.
- Aligned release pipeline to JiraPS publish contract (`Invoke-Build -Task Publish`) and changelog-driven release body generation.
- Added `changelog-to-release` configuration wiring and enforced first-party smoke credential validation while keeping fork/Dependabot PR smoke skipped.
- `Set-ConfluencePage` now forwards `Version.Message` for `-InputObject` / pipeline updates when provided (#207, #231, [@JoseAPortilloJSC])

### Fixed
Expand Down
25 changes: 9 additions & 16 deletions Tests/Tools/StandardsVersionConsistency.Unit.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ Describe 'AtlassianPS.Standards version consistency' -Tag Unit {
$projectRoot = Get-RepositoryRoot

$buildRequirementsPath = Join-Path -Path $projectRoot -ChildPath 'Tools/build.requirements.psd1'
$buildRequirements = Import-PowerShellDataFile -Path $buildRequirementsPath
$standardsRequirement = $buildRequirements |
Where-Object { $_.ModuleName -eq 'AtlassianPS.Standards' } |
Select-Object -First 1
$standardsVersion = [string] $standardsRequirement.RequiredVersion
$buildRequirementsContent = Get-Content -LiteralPath $buildRequirementsPath -Raw
$standardsVersionMatch = [regex]::Match(
$buildRequirementsContent,
'ModuleName\s*=\s*["'']AtlassianPS\.Standards["'']\s*;\s*RequiredVersion\s*=\s*["''](?<version>[^"'']+)["'']'
)
$standardsVersionMatch.Success | Should -BeTrue
$standardsVersion = $standardsVersionMatch.Groups['version'].Value

$workflowPaths = Get-ChildItem -Path (Join-Path -Path $projectRoot -ChildPath '.github/workflows') -File -Filter '*.yml' |
Select-Object -ExpandProperty FullName
Expand All @@ -43,7 +45,7 @@ Describe 'AtlassianPS.Standards version consistency' -Tag Unit {
$workflowContent = Get-Content -LiteralPath $workflowPath -Raw
[regex]::Matches(
$workflowContent,
"AtlassianPS/AtlassianPS\.Standards/\.github/actions/setup-powershell@(?<sha>[0-9a-f]{40})(?:\s+#\s+v(?<version>[0-9]+\.[0-9]+\.[0-9]+))?"
"AtlassianPS/AtlassianPS\.Standards/\.github/actions/setup-powershell@(?<sha>[0-9a-f]{40})\s+#\s+v(?<version>[0-9]+\.[0-9]+\.[0-9]+)"
) | ForEach-Object {
[PSCustomObject]@{
WorkflowPath = $workflowPath
Expand All @@ -55,17 +57,8 @@ Describe 'AtlassianPS.Standards version consistency' -Tag Unit {

@($workflowActionMatches).Count | Should -BeGreaterThan 0

($workflowActionMatches | Select-Object -ExpandProperty Version -Unique) | Should -Be @($standardsVersion)
@($workflowActionMatches | Select-Object -ExpandProperty Sha -Unique).Count | Should -Be 1

$matchedVersions = @(
$workflowActionMatches |
Where-Object { -not [string]::IsNullOrWhiteSpace($_.Version) } |
Select-Object -ExpandProperty Version -Unique
)
if ($matchedVersions.Count -gt 0) {
$matchedVersions.Count | Should -Be 1
$matchedVersions[0] | Should -Be $standardsVersion
}
}

It 'reads AtlassianPS.Standards version from build.requirements in tool scripts' {
Expand Down
Loading