-
Notifications
You must be signed in to change notification settings - Fork 66
ci: add manual gem yank workflow #129
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
2 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,58 @@ | ||
| name: Yank Gem Version | ||
|
|
||
| # Manually yank (or un-yank) a published chargebee version from RubyGems. | ||
| # Reuses the GEM_HOST_API_KEY secret already used by the release workflow. | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Gem version to yank (e.g. 2.75.0)" | ||
| required: true | ||
| type: string | ||
| confirm: | ||
| description: "Re-type the exact version to confirm" | ||
| required: true | ||
| type: string | ||
| undo: | ||
| description: "Un-yank instead (re-list a previously yanked version)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| yank: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| VERSION: ${{ inputs.version }} | ||
| CONFIRM: ${{ inputs.confirm }} | ||
| UNDO: ${{ inputs.undo }} | ||
| steps: | ||
| - name: Validate inputs | ||
| run: | | ||
| if [ "$VERSION" != "$CONFIRM" ]; then | ||
| echo "❌ Confirmation ('$CONFIRM') does not match version ('$VERSION'). Aborting." | ||
| exit 1 | ||
| fi | ||
| if ! printf '%s' "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+)*$'; then | ||
| echo "❌ Invalid version format: '$VERSION'" | ||
| exit 1 | ||
| fi | ||
| echo "✅ Inputs valid." | ||
|
|
||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.0' | ||
|
|
||
| - name: Yank / un-yank gem | ||
| env: | ||
| GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} | ||
| run: | | ||
| if [ "$UNDO" = "true" ]; then | ||
| echo "↩️ Un-yanking chargebee $VERSION ..." | ||
| gem yank chargebee -v "$VERSION" --undo | ||
| else | ||
| echo "🗑️ Yanking chargebee $VERSION ..." | ||
| gem yank chargebee -v "$VERSION" | ||
| fi | ||
| echo "✅ Done." | ||
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.
🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
sed -n '1,220p' .github/workflows/yank.ymlRepository: chargebee/chargebee-ruby
Length of output: 1901
🌐 Web query:
RubyGems yank undo support gem yank --undo rubygems.org documentation💡 Result:
The --undo option for the gem yank command is no longer supported in RubyGems [1]. While earlier versions of RubyGems included an --undo flag to facilitate "unyanking" a gem, this functionality was removed around 2015 [1]. Consequently, modern versions of the RubyGems CLI do not recognize the --undo argument and will return an error if it is used [1]. There is no official "undo" mechanism for yanking a gem via the command-line interface [2][3]. If a gem version has been yanked, it is typically necessary to push a new version of the gem to the server to make it available again [3].
Citations:
Remove the
undopath;gem yank --undois unsupported by RubyGems.org.This workflow exposes an option that modern RubyGems rejects, so the “un-yank” branch will fail in practice. Remove the input/branch or replace it with a manual support flow.
🤖 Prompt for AI Agents