Create gem-push.yml - #4198
Create gem-push.yml#4198heathermomof2 wants to merge 1 commit into
Conversation
|
There was a problem hiding this comment.
🟡 Changes recommended
The workflow as added is not safe/correct to run as written (publishes on PRs/non-release pushes, uses an incompatible Ruby version, and GitHub Packages publishing conflicts with the gemspec’s allowed push host).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds a new GitHub Actions workflow intended to build and publish the primer_view_components Ruby gem from this repository.
Changes:
- Introduces
.github/workflows/gem-push.ymlto run a “Build + Publish” job. - Adds steps to publish the built gem to GitHub Packages (GPR) and RubyGems.
File summaries
| File | Description |
|---|---|
| .github/workflows/gem-push.yml | Adds a workflow to build and publish the Ruby gem to registries. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
| - name: Set up Ruby 2.6 | ||
| # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, | ||
| # change this to (see https://github.com/ruby/setup-ruby#versioning): | ||
| # uses: ruby/setup-ruby@v1 | ||
| uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 | ||
| with: | ||
| ruby-version: 2.6.x | ||
|
|
| gem build *.gemspec | ||
| gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem | ||
| env: |
| - name: Publish to RubyGems | ||
| run: | | ||
| mkdir -p $HOME/.gem | ||
| touch $HOME/.gem/credentials | ||
| chmod 0600 $HOME/.gem/credentials | ||
| printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
| gem build *.gemspec | ||
| gem push *.gem | ||
| env: | ||
| GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" |
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
Screenshots
Integration
List the issues that this change affects.
Closes # (type the GitHub issue number after #)
Risk Assessment
What approach did you choose and why?
Anything you want to highlight for special attention from reviewers?
Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.