Skip to content

Commit a4ae257

Browse files
vaindclaude
andcommitted
fix: Remove workflow file updates from Craft release automation
GitHub Apps cannot modify workflow files without 'workflows' permission, causing Craft releases to fail when trying to update _workflow_version defaults. The script now provides manual instructions instead. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c8c3a19 commit a4ae257

File tree

1 file changed

+16
-30
lines changed

1 file changed

+16
-30
lines changed

scripts/update-version.ps1

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,19 @@ Set-StrictMode -Version Latest
1212
$ErrorActionPreference = "Stop"
1313
$PSNativeCommandUseErrorActionPreference = $true
1414

15-
Write-Host "Updating version from $OldVersion to $NewVersion"
16-
17-
# Update specific workflow files with _workflow_version inputs
18-
Write-Host "Updating workflow files..."
19-
$workflowFiles = @(
20-
".github/workflows/updater.yml",
21-
".github/workflows/danger.yml"
22-
)
23-
24-
foreach ($filePath in $workflowFiles) {
25-
$content = Get-Content -Path $filePath -Raw
26-
27-
# Check if this file has _workflow_version input with a default value
28-
if ($content -match '(?ms)_workflow_version:.*?default:\s*([^\s#]+)') {
29-
Write-Host "Updating $filePath..."
30-
$oldDefault = $Matches[1]
31-
32-
# Replace the default value for _workflow_version
33-
$newContent = $content -replace '((?ms)_workflow_version:.*?default:\s*)([^\s#]+)', "`${1}'$NewVersion'"
34-
35-
# Write the updated content back to the file
36-
$newContent | Out-File -FilePath $filePath -Encoding utf8 -NoNewline
37-
38-
Write-Host " Updated default from '$oldDefault' to '$NewVersion'"
39-
} else {
40-
Write-Error "No _workflow_version default found in $filePath"
41-
}
42-
}
43-
44-
Write-Host "Version update completed successfully!"
15+
Write-Host "Preparing release version update from $OldVersion to $NewVersion"
16+
17+
# Note: Workflow files cannot be updated automatically during Craft releases
18+
# because GitHub Apps don't have 'workflows' permission by default.
19+
#
20+
# After this release is published, manually update the following files:
21+
# - .github/workflows/updater.yml (line ~45)
22+
# - .github/workflows/danger.yml (line ~9)
23+
#
24+
# Change the default value from '$OldVersion' to '$NewVersion'
25+
26+
Write-Host ""
27+
Write-Host "⚠️ MANUAL ACTION REQUIRED AFTER RELEASE:"
28+
Write-Host "Update _workflow_version defaults in workflow files from '$OldVersion' to '$NewVersion'"
29+
Write-Host ""
30+
Write-Host "Release preparation completed successfully!"

0 commit comments

Comments
 (0)