-
Notifications
You must be signed in to change notification settings - Fork 25
SCANNPM-133 feat: Automatically create Update Center PR on release #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fe98614
feat: Automatically create Update Center PR on release
vdiez 4083e9c
feat: Add release template with Description field
vdiez 163af7b
fix: Use correct vault secret path for release automation
vdiez 546f93a
fix: Remove --reviewer flag from PR creation
vdiez 6ce1ec5
feat: Add Slack notification for new releases
vdiez 6624d7d
feat: Add Slack notification with configurable channel
vdiez d923099
fix: Use squad-web-private as default Slack channel
vdiez 255551b
fix: Use Slack bot token instead of webhook for notifications
vdiez 89af44a
fix: Enable error reporting for Slack notifications
vdiez ec581e6
fix: Use Slack channel ID instead of name
vdiez 5e9ec36
fix: Try ask-squad-web channel for Slack notifications
vdiez 973bd02
refactor: Extract Update Center logic to shell script
vdiez 1f68c9d
fix: Use private-reader token for integration tests
vdiez 2e21e26
fix: Handle HTTP redirects in SonarQube download
vdiez d2a0399
docs: Add post-release steps for Update Center and documentation
vdiez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Description: | ||
|
|
||
| ## What's Changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Updates the scannernpm.properties file in sonar-update-center-properties | ||
| # for a new release. | ||
| # | ||
| # Usage: update-update-center.sh <file> <version> <description> | ||
| # | ||
| # This script: | ||
| # 1. Moves the current publicVersions to archivedVersions | ||
| # 2. Sets the new version as publicVersions | ||
| # 3. Adds version metadata (description, date, URLs) | ||
| # | ||
| set -euo pipefail | ||
|
|
||
| if [ $# -ne 3 ]; then | ||
| echo "Usage: $0 <file> <version> <description>" | ||
| exit 1 | ||
| fi | ||
|
|
||
| FILE="$1" | ||
| VERSION="$2" | ||
| DESCRIPTION="$3" | ||
| DATE=$(date +%Y-%m-%d) | ||
|
|
||
| if [ ! -f "$FILE" ]; then | ||
| echo "Error: File not found: $FILE" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Get current publicVersions | ||
| CURRENT_PUBLIC=$(grep "^publicVersions=" "$FILE" | cut -d= -f2) | ||
|
|
||
| # Get current archivedVersions | ||
| CURRENT_ARCHIVED=$(grep "^archivedVersions=" "$FILE" | cut -d= -f2) | ||
|
|
||
| # Update archivedVersions: append current public versions | ||
| if [ -n "$CURRENT_ARCHIVED" ]; then | ||
| NEW_ARCHIVED="${CURRENT_ARCHIVED},${CURRENT_PUBLIC}" | ||
| else | ||
| NEW_ARCHIVED="${CURRENT_PUBLIC}" | ||
| fi | ||
|
|
||
| # Update the file | ||
| sed -i "s/^archivedVersions=.*/archivedVersions=${NEW_ARCHIVED}/" "$FILE" | ||
| sed -i "s/^publicVersions=.*/publicVersions=${VERSION}/" "$FILE" | ||
|
|
||
| # Find the line number of publicVersions and insert new version entry after it | ||
| LINE_NUM=$(grep -n "^publicVersions=" "$FILE" | cut -d: -f1) | ||
|
|
||
| # Create the new version entry | ||
| NEW_ENTRY="${VERSION}.description=${DESCRIPTION} | ||
| ${VERSION}.date=${DATE} | ||
| ${VERSION}.changelogUrl=https://github.com/SonarSource/sonar-scanner-npm/releases/tag/${VERSION} | ||
| ${VERSION}.downloadUrl=https://www.npmjs.com/package/@sonar/scan/v/${VERSION}" | ||
|
|
||
| # Insert after the publicVersions line | ||
| awk -v line="$LINE_NUM" -v entry="$NEW_ENTRY" 'NR==line {print; print ""; print entry; next} 1' "$FILE" > tmp && mv tmp "$FILE" | ||
|
|
||
| echo "Updated $FILE for version $VERSION" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.