-
Notifications
You must be signed in to change notification settings - Fork 115
feat(repo): add deprecate-archived-plugins workflow from BCP #2664
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
hopehadfield
merged 3 commits into
redhat-developer:main
from
christoph-jerolimov:repo/add-deprecate-archived-plugins-workflow
Apr 1, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,26 @@ | ||
| name: Deprecate Archived Plugins | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - '.github/archived-plugins.json' | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| deprecate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22.x | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Deprecate packages | ||
| run: ./scripts/ci/deprecate-archived-plugins.sh | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.RHDH_NPM_TOKEN }} | ||
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org |
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 | ||
|
|
||
| set -e | ||
|
|
||
| # Get script directory and archived file path | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| ARCHIVED_FILE="$(dirname "$(dirname "$SCRIPT_DIR")")/.github/archived-plugins.json" | ||
|
|
||
| # Check if dry run (first argument) | ||
| DRY_RUN=${1:-false} | ||
|
|
||
| if [[ "$DRY_RUN" == "--dry-run" ]]; then | ||
| DRY_RUN=true | ||
| echo "DRY RUN MODE" | ||
| else | ||
| DRY_RUN=false | ||
| fi | ||
|
|
||
| echo "Processing archived packages..." | ||
|
|
||
| # Extract unique plugins from archived-plugins.json file | ||
| # Format: package_name|workspace|plugin|reason | ||
| jq -r ' | ||
| .archived | ||
| | unique_by(.pluginName) | ||
| | .[] | ||
| | "\(.pluginName)|\(.workspace)|\(.plugin)|\(.reason)" | ||
| ' "$ARCHIVED_FILE" | while IFS='|' read -r package_name workspace plugin reason; do | ||
|
|
||
| # Check if already deprecated | ||
| if npm view "$package_name" deprecated 2>/dev/null | grep -q .; then | ||
| echo "Already deprecated: $package_name" | ||
| continue | ||
| fi | ||
| # Generate deprecation message | ||
| message="This package has been archived from the redhat-developer/rhdh-plugins repository" | ||
| [[ -n "$plugin" ]] && message="$message (plugin: $plugin)" | ||
| [[ -n "$reason" ]] && message="$message. Reason: $reason" | ||
| message="$message." | ||
|
|
||
| if [[ "$DRY_RUN" == "true" ]]; then | ||
| echo "Would deprecate: $package_name" | ||
| echo " Message: $message" | ||
| else | ||
| echo "Deprecating: $package_name" | ||
|
|
||
| # Validate package exists and is accessible before deprecating | ||
| if ! npm view "$package_name" version &>/dev/null; then | ||
| echo "Error: Cannot view package $package_name" | ||
|
Check warning on line 49 in scripts/ci/deprecate-archived-plugins.sh
|
||
| continue | ||
| fi | ||
|
|
||
| echo "Running: npm deprecate $package_name \"$message\"" | ||
| npm deprecate "$package_name" "$message" | ||
| echo "Done: $package_name" | ||
| fi | ||
| done | ||
|
|
||
| echo "Complete!" | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Pipeline masks jq failure
🐞 Bug☼ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools