Skip to content
Merged
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
58 changes: 58 additions & 0 deletions .github/workflows/yank.yml
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
Comment on lines +16 to +20

Copy link
Copy Markdown

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.yml

Repository: 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 undo path; gem yank --undo is 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
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/yank.yml around lines 16 - 20, The workflow currently
exposes an unsupported undo/un-yank path through the inputs and branch logic in
the yank workflow. Remove the undo input and any conditional handling tied to it
in the workflow logic, and keep only the standard yank behavior in the job flow;
if an alternate un-yank process is needed, move it to a separate manual support
path outside the workflow.


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."
Loading