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
23 changes: 12 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [#16](https://github.com/numbata/danger-pr-comment/pull/16): Remove the `RELEASERS` allowlist and actor-matching release gate in favor of GitHub environment approval configuration - [@dblock](https://github.com/dblock).
- [#15](https://github.com/numbata/danger-pr-comment/pull/15): Migrate release automation to [ruby-gem-release](https://github.com/dblock/ruby-gem-release) 0.4.0, preserving release access restrictions and workflow reference updates while allowing unpublished maintenance versions below the latest release - [@dblock](https://github.com/dblock).
- [#18](https://github.com/danger/danger-pr-comment/pull/18): Point the README, installer, gemspec, and release tooling at the `danger` organization after the repository transfer - [@numbata](https://github.com/numbata).
- [#16](https://github.com/danger/danger-pr-comment/pull/16): Remove the `RELEASERS` allowlist and actor-matching release gate in favor of GitHub environment approval configuration - [@dblock](https://github.com/dblock).
- [#15](https://github.com/danger/danger-pr-comment/pull/15): Migrate release automation to [ruby-gem-release](https://github.com/dblock/ruby-gem-release) 0.4.0, preserving release access restrictions and workflow reference updates while allowing unpublished maintenance versions below the latest release - [@dblock](https://github.com/dblock).

## [0.2.0] - 2026-11-07

### Added

- [#14](https://github.com/numbata/danger-pr-comment/pull/14): Add SimpleCov coverage reporting to Coveralls - [@dblock](https://github.com/dblock).
- [#13](https://github.com/numbata/danger-pr-comment/pull/13): Add a `gemfile` input to the Danger Run workflow for selecting a non-default Gemfile - [@dblock](https://github.com/dblock).
- [#10](https://github.com/numbata/danger-pr-comment/pull/10): Automate release changelog preparation and update workflow tag references in the README, installer, and installer specs - [@dblock](https://github.com/dblock).
- [#12](https://github.com/numbata/danger-pr-comment/pull/12): Add a version input and restricted access to the release workflow, and reject versions that already exist - [@numbata](https://github.com/numbata).
- [#14](https://github.com/danger/danger-pr-comment/pull/14): Add SimpleCov coverage reporting to Coveralls - [@dblock](https://github.com/dblock).
- [#13](https://github.com/danger/danger-pr-comment/pull/13): Add a `gemfile` input to the Danger Run workflow for selecting a non-default Gemfile - [@dblock](https://github.com/dblock).
- [#10](https://github.com/danger/danger-pr-comment/pull/10): Automate release changelog preparation and update workflow tag references in the README, installer, and installer specs - [@dblock](https://github.com/dblock).
- [#12](https://github.com/danger/danger-pr-comment/pull/12): Add a version input and restricted access to the release workflow, and reject versions that already exist - [@numbata](https://github.com/numbata).

## [0.1.1] - 2026-10-21

### Added

- [#2](https://github.com/numbata/danger-pr-comment/pull/2): Add automated releases using RubyGems Trusted Publishing, with release validation, GitHub release creation, and next development version preparation - [@dblock](https://github.com/dblock).
- [#6](https://github.com/numbata/danger-pr-comment/pull/6): Setup danger workflows as an example - [@numbata](https://github.com/numbata).
- [#1](https://github.com/numbata/danger-pr-comment/pull/1): Add comprehensive test suite with RSpec, Rubocop, and CI - [@dblock](https://github.com/dblock).
* [#4](https://github.com/numbata/danger-pr-comment/pull/4): Improve install script documentation - [@dblock](https://github.com/dblock).
- [#2](https://github.com/danger/danger-pr-comment/pull/2): Add automated releases using RubyGems Trusted Publishing, with release validation, GitHub release creation, and next development version preparation - [@dblock](https://github.com/dblock).
- [#6](https://github.com/danger/danger-pr-comment/pull/6): Setup danger workflows as an example - [@numbata](https://github.com/numbata).
- [#1](https://github.com/danger/danger-pr-comment/pull/1): Add comprehensive test suite with RSpec, Rubocop, and CI - [@dblock](https://github.com/dblock).
* [#4](https://github.com/danger/danger-pr-comment/pull/4): Improve install script documentation - [@dblock](https://github.com/dblock).

### Fixed

- [#7](https://github.com/numbata/danger-pr-comment/pull/7): Add required permissions to workflow examples and templates - [@numbata](https://github.com/numbata).
- [#7](https://github.com/danger/danger-pr-comment/pull/7): Add required permissions to workflow examples and templates - [@numbata](https://github.com/numbata).

## [0.1.0] - 2024-01-01

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Danger PR Comment

[![Test](https://github.com/numbata/danger-pr-comment/actions/workflows/test.yml/badge.svg)](https://github.com/numbata/danger-pr-comment/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/numbata/danger-pr-comment/badge.svg?branch=main)](https://coveralls.io/github/numbata/danger-pr-comment?branch=main)
[![Test](https://github.com/danger/danger-pr-comment/actions/workflows/test.yml/badge.svg)](https://github.com/danger/danger-pr-comment/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/danger/danger-pr-comment/badge.svg?branch=main)](https://coveralls.io/github/danger/danger-pr-comment?branch=main)

Reusable GitHub Actions workflows for running Danger and posting a PR comment from a JSON report.

Expand Down Expand Up @@ -58,19 +58,19 @@ Could not find the type of CI for Danger to run on.
From your repository root:

```bash
curl -fsSL https://raw.githubusercontent.com/numbata/danger-pr-comment/main/scripts/install-workflows.sh | bash
curl -fsSL https://raw.githubusercontent.com/danger/danger-pr-comment/main/scripts/install-workflows.sh | bash
```

Use `--force` to overwrite existing workflow files `.github/workflows/danger.yml` and `.github/workflows/danger-comment.yml`:

```bash
curl -fsSL https://raw.githubusercontent.com/numbata/danger-pr-comment/main/scripts/install-workflows.sh | bash -s -- --force
curl -fsSL https://raw.githubusercontent.com/danger/danger-pr-comment/main/scripts/install-workflows.sh | bash -s -- --force
```

To target a specific directory:

```bash
curl -fsSL https://raw.githubusercontent.com/numbata/danger-pr-comment/main/scripts/install-workflows.sh | bash -s -- --root /path/to/repo
curl -fsSL https://raw.githubusercontent.com/danger/danger-pr-comment/main/scripts/install-workflows.sh | bash -s -- --root /path/to/repo
```

### Manual Setup
Expand All @@ -85,7 +85,7 @@ on:

jobs:
danger:
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.2.0
uses: danger/danger-pr-comment/.github/workflows/danger-run.yml@v0.2.0
secrets: inherit
with:
ruby-version: '3.4'
Expand All @@ -108,7 +108,7 @@ permissions:

jobs:
comment:
uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.2.0
uses: danger/danger-pr-comment/.github/workflows/danger-comment.yml@v0.2.0
secrets: inherit
```

Expand Down
6 changes: 2 additions & 4 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ The development dependency and reusable workflow are pinned to `ruby-gem-release
## One-time setup

1. In **Settings > Environments**, create an environment named `release` and restrict deployments to `main`. To restrict publication to release maintainers, add `numbata` and `dblock` as required reviewers and disable administrator bypass. Leave **Prevent self-review** unchecked to allow a maintainer to dispatch and approve their own release; enable it if a second maintainer must approve. Configure these protections before relying on maintainer-only publication.
2. As a gem owner, open [Trusted publishers](https://rubygems.org/gems/danger-pr-comment/trusted_publishers) on RubyGems.org. Configure repository owner `numbata`, repository name `danger-pr-comment`, workflow filename `release.yml`, and environment `release`. Set the separate **workflow repository** fields to owner `dblock` and repository `ruby-gem-release`. Existing publishers must be updated for the reusable workflow; the old standalone-workflow configuration is not sufficient. Use the actual caller owner and repository when publishing from another repository; forks are not automatically trusted.
2. As a gem owner, open [Trusted publishers](https://rubygems.org/gems/danger-pr-comment/trusted_publishers) on RubyGems.org. Configure repository owner `danger`, repository name `danger-pr-comment`, workflow filename `release.yml`, and environment `release`. Set the separate **workflow repository** fields to owner `dblock` and repository `ruby-gem-release`. Existing publishers must be updated for the reusable workflow; the old standalone-workflow configuration is not sufficient. Use the actual caller owner and repository when publishing from another repository; forks are not automatically trusted.
3. Ensure branch rules allow the Actions bot to push release preparation and the next development version directly to `main`.

The caller grants `contents: write` and `id-token: write` to the reusable workflow and runs only on `main`. The reusable workflow uses the `release` environment, authenticates through OIDC, and serializes releases. Repository writers can dispatch or rerun the workflow, but required environment reviewers control approval before the release job starts. Without required reviewers, repository writers can publish without maintainer approval. Repository variables are not an independent authorization boundary because writers can edit them.

The old `RELEASERS` repository variable is no longer used and can be deleted with `gh variable delete RELEASERS --repo numbata/danger-pr-comment` after the workflow change is merged.

After verifying trusted publishing works, remove any obsolete `RUBYGEMS_API_KEY` repository secret and revoke its RubyGems API key if it is no longer used elsewhere.

## Prepare and publish

Start from current `main`, review changes since the last release, and maintain nonempty release notes under `## [Unreleased]` in `CHANGELOG.md`. The previous release increments `lib/danger-pr-comment/version.rb` to the next patch version, so a normal patch release needs no manual version change.

Run the [Release workflow](https://github.com/numbata/danger-pr-comment/actions/workflows/release.yml) on `main`, or use:
Run the [Release workflow](https://github.com/danger/danger-pr-comment/actions/workflows/release.yml) on `main`, or use:

```sh
gh workflow run release.yml --ref main # release the version in version.rb
Expand Down
2 changes: 1 addition & 1 deletion danger-pr-comment.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.version = DangerPrComment::VERSION
s.authors = ['Andrei Subbota']
s.email = ['numbata@users.noreply.github.com']
s.homepage = 'https://github.com/numbata/danger-pr-comment'
s.homepage = 'https://github.com/danger/danger-pr-comment'
s.summary = 'Reusable workflows and shared Dangerfile for PR comment reporting.'
s.description = 'Shared Dangerfile that exports a JSON report for posting Danger results as a PR comment.'
s.license = 'MIT'
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ on:

jobs:
danger:
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.2.0
uses: danger/danger-pr-comment/.github/workflows/danger-run.yml@v0.2.0
secrets: inherit
with:
ruby-version: '3.4'
Expand All @@ -90,6 +90,6 @@ permissions:

jobs:
comment:
uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.2.0
uses: danger/danger-pr-comment/.github/workflows/danger-comment.yml@v0.2.0
secrets: inherit
EOF
2 changes: 1 addition & 1 deletion scripts/release_preparation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def workflow_updates(version)

def update_references(content, version, path)
%w[run comment].reduce(content) do |text, workflow|
pattern = %r{(numbata/danger-pr-comment/\.github/workflows/danger-#{workflow}\.yml@)(?:v\d+\.\d+\.\d+|main)(?=['"\s]|$)}
pattern = %r{(danger/danger-pr-comment/\.github/workflows/danger-#{workflow}\.yml@)(?:v\d+\.\d+\.\d+|main)(?=['"\s]|$)}
raise "Expected exactly one danger-#{workflow} workflow reference in #{path}" unless text.scan(pattern).one?

text.sub(pattern) { "#{Regexp.last_match(1)}v#{version}" }
Expand Down
4 changes: 2 additions & 2 deletions spec/scripts/install_workflows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def danger_comment_yml_path

it 'uses the reusable workflow' do
content = File.read(danger_yml_path)
expect(content).to include('uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.2.0')
expect(content).to include('uses: danger/danger-pr-comment/.github/workflows/danger-run.yml@v0.2.0')
end

it 'inherits secrets' do
Expand Down Expand Up @@ -94,7 +94,7 @@ def danger_comment_yml_path

it 'uses the reusable workflow' do
content = File.read(danger_comment_yml_path)
expect(content).to include('uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.2.0')
expect(content).to include('uses: danger/danger-pr-comment/.github/workflows/danger-comment.yml@v0.2.0')
end

it 'inherits secrets' do
Expand Down
Loading