Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release gem to RubyGems.org

on:
workflow_dispatch:

jobs:
release:
uses: SOFware/reissue/.github/workflows/shared-ruby-gem-release.yml@main
with:
git_user_email: 'gems@sofwarellc.com'
git_user_name: 'SOFware'
ruby_version: '3.4'
Comment on lines +8 to +12

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI about 2 months ago

In general, the fix is to explicitly specify a permissions block for the workflow or for the release job so the GITHUB_TOKEN is not implicitly granted broad repository defaults. Since this workflow only delegates to a reusable workflow via uses:, the safest, non‑breaking approach is to define minimal permissions at the job level, letting the reusable workflow request any additional fine-grained permissions it truly needs (if it does so). As a conservative baseline consistent with GitHub’s recommendations, we can grant read-only access to repository contents (and nothing else) in this caller workflow.

Concretely, in .github/workflows/release.yml, within the jobs: section, add a permissions: block under the release job (i.e., at the same indentation level as uses:) with contents: read. This ensures that the release job’s GITHUB_TOKEN is limited unless the called workflow itself defines additional permissions. No imports or external methods are needed; this is a pure YAML configuration change. The only lines to change are around the release job definition, inserting the new permissions block without modifying the existing uses or with configuration.

Suggested changeset 1
.github/workflows/release.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -5,6 +5,8 @@
 
 jobs:
   release:
+    permissions:
+      contents: read
     uses: SOFware/reissue/.github/workflows/shared-ruby-gem-release.yml@main
     with:
       git_user_email: 'gems@sofwarellc.com'
EOF
@@ -5,6 +5,8 @@

jobs:
release:
permissions:
contents: read
uses: SOFware/reissue/.github/workflows/shared-ruby-gem-release.yml@main
with:
git_user_email: 'gems@sofwarellc.com'
Copilot is powered by AI and may make mistakes. Always verify output.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,9 @@ Or install it yourself as:
$ gem install close_encounters
```

## Releasing

This project is managed with [Reissue](https://github.com/SOFware/reissue). Releases are automated via the [shared release workflow](https://github.com/SOFware/reissue/blob/main/.github/workflows/SHARED_WORKFLOW_README.md). Trigger a release by running the "Release gem to RubyGems.org" workflow from the Actions tab.

## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require "reissue/gem"

Reissue::Task.create :reissue do |task|
task.version_file = "lib/close_encounters/version.rb"
task.push_finalize = :branch
end

require "standard/rake"
Expand Down