From 5ccfeee65bdaef37e296fcee842fdf0cbfd7905f Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:24:31 +0100 Subject: [PATCH 01/10] Fix action lint step: install the gem where the runner can run it GitHub-hosted runners make the system gem dir unwritable, so gem install falls back to a user dir that is not on PATH and the lint step cannot find se (TonyCTHsu/simple-english#135). Pin GEM_HOME to a temp dir and append its bin to GITHUB_PATH. --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index 00f8f3b..5186ee5 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ runs: shell: bash env: ACTION_REF: ${{ github.action_ref }} + # GitHub-hosted runners make the system gem dir unwritable, so gem + # falls back to a user dir the runner never puts on PATH. Pin a home + # we control and put its bin on PATH for the Lint step below. + GEM_HOME: ${{ runner.temp }}/gems run: | VERSION="${{ inputs.version }}" if [ -z "$VERSION" ]; then @@ -35,6 +39,7 @@ runs: else gem install simple_english --no-document fi + echo "$GEM_HOME/bin" >> "$GITHUB_PATH" - name: Lint id: lint shell: bash From 17d6067c53e3dbcf4fe9eaebd8b24a04104ae313 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:33:19 +0100 Subject: [PATCH 02/10] Document the Ruby requirement for action users The action runs the runner ruby and gem. Say so in the README, and warn self-hosted users off the macOS system Ruby, which is 2.6 and older than the supported floor. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 20c7490..86d2809 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,11 @@ To see the findings inline in the pull request, lint with if: always() ``` +The action uses the runner's `ruby` and `gem`, and needs Ruby 3.3 or +newer. The `ubuntu-latest` image ships one. On a self-hosted runner, +install a current Ruby first: the macOS system Ruby is 2.6 and too +old. + Any CI can run the lint. Install the gem, run `se lint .`, and fail the build on exit code 1. From 766226fd5d90b8a0a904c8271dab07842def53cf Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:34:57 +0100 Subject: [PATCH 03/10] Move the Ruby requirement note to the gem install section The action just works on its runners, so it needs no runner note. The system Ruby warning belongs where a local, non-Ruby engineer hits it: right under gem install, pointing at the Homebrew install as the easy path. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 86d2809..7bfa8a9 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,11 @@ The full list, with a wrong and a right example for each rule [docs/RULES.md](do gem install simple_english ``` +The gem needs Ruby 3.3 or newer. Do not use the macOS system Ruby: it +is 2.6, too old, and rejects gem installs with a permission error. +Install a current Ruby with Homebrew or a version manager. On a Mac +without a Ruby setup, prefer the Homebrew install below. + ### Homebrew (macOS arm64) ```bash @@ -167,11 +172,6 @@ To see the findings inline in the pull request, lint with if: always() ``` -The action uses the runner's `ruby` and `gem`, and needs Ruby 3.3 or -newer. The `ubuntu-latest` image ships one. On a self-hosted runner, -install a current Ruby first: the macOS system Ruby is 2.6 and too -old. - Any CI can run the lint. Install the gem, run `se lint .`, and fail the build on exit code 1. From 061b348302582c0ce6ed343a1433a714012c82ed Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:36:18 +0100 Subject: [PATCH 04/10] Point Mac gem users at brew install ruby Prefer the gem install over the Homebrew tap. On a Mac without Ruby, the note now builds the path: brew install ruby, put the directories brew info ruby lists on PATH, then install the gem. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7bfa8a9..9eb3f77 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,8 @@ gem install simple_english The gem needs Ruby 3.3 or newer. Do not use the macOS system Ruby: it is 2.6, too old, and rejects gem installs with a permission error. -Install a current Ruby with Homebrew or a version manager. On a Mac -without a Ruby setup, prefer the Homebrew install below. +Install Ruby with `brew install ruby`, put the directories `brew info +ruby` lists on your `PATH`, then `gem install simple_english`. ### Homebrew (macOS arm64) From 7638f60eaf1707dc01177cc6e26a7147d050e906 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:40:35 +0100 Subject: [PATCH 05/10] Add a Prerequisites subsection to Install\n\nState the Ruby floor, give brew install ruby as one example path, and\nname version managers as the alternative. Tell, do not explain. --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9eb3f77..5ef3bef 100644 --- a/README.md +++ b/README.md @@ -72,17 +72,24 @@ The full list, with a wrong and a right example for each rule [docs/RULES.md](do ## Install +### Prerequisites + +The gem needs Ruby 3.3 or newer. On a Mac, the system Ruby (2.6) is too +old. Install one, for example with Homebrew: + +```bash +brew install ruby +``` + +Follow the `PATH` caveats Homebrew prints. A version manager such as +`mise` or `rbenv` works too. + ### Ruby gem (macOS arm64, Linux x86-64 and arm64) ```bash gem install simple_english ``` -The gem needs Ruby 3.3 or newer. Do not use the macOS system Ruby: it -is 2.6, too old, and rejects gem installs with a permission error. -Install Ruby with `brew install ruby`, put the directories `brew info -ruby` lists on your `PATH`, then `gem install simple_english`. - ### Homebrew (macOS arm64) ```bash From 55cac4dcc06392423fdeb8e66565f9691d67ca70 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:43:01 +0100 Subject: [PATCH 06/10] Show the PATH exports in Prerequisites instead of caveats Pointing at brew caveats leaves the reader translating. Show the three export lines: brewed ruby, a stable GEM_HOME, and its bin dir. The paths never change with a Ruby upgrade. --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ef3bef..33ba118 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,17 @@ old. Install one, for example with Homebrew: brew install ruby ``` -Follow the `PATH` caveats Homebrew prints. A version manager such as -`mise` or `rbenv` works too. +Homebrew's Ruby is not on the `PATH` by default, and neither are gem +binaries. Put both in your shell profile: + +```bash +echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc +echo 'export GEM_HOME="$HOME/.gem"' >> ~/.zshrc +echo 'export PATH="$GEM_HOME/bin:$PATH"' >> ~/.zshrc +``` + +Then open a new terminal. A version manager such as `mise` or `rbenv` +works too. ### Ruby gem (macOS arm64, Linux x86-64 and arm64) From 217eb90b41bc0fcf53b7f199fb76f4be3c441fb3 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:52:06 +0100 Subject: [PATCH 07/10] Drop the corrected-behavior clause from both action fragments Review call: the symptom and its condition carry the entry; the corrected behavior restates what a fix obviously does. --- .changes/unreleased/Fixed-20261108-215904.yaml | 2 +- .changes/unreleased/Fixed-20261108-222426.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixed-20261108-222426.yaml diff --git a/.changes/unreleased/Fixed-20261108-215904.yaml b/.changes/unreleased/Fixed-20261108-215904.yaml index 616acad..11bada4 100644 --- a/.changes/unreleased/Fixed-20261108-215904.yaml +++ b/.changes/unreleased/Fixed-20261108-215904.yaml @@ -1,3 +1,3 @@ kind: Fixed -body: Fix `gem install` failing with `BadRequirementError` at action refs with no `version` input, which installs the action's version or latest release. +body: Fix `gem install` failing with `BadRequirementError` at action refs with no `version` input. time: 2026-11-08T21:59:04.551561+01:00 diff --git a/.changes/unreleased/Fixed-20261108-222426.yaml b/.changes/unreleased/Fixed-20261108-222426.yaml new file mode 100644 index 0000000..74b69b0 --- /dev/null +++ b/.changes/unreleased/Fixed-20261108-222426.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: 'Fix `se: command not found` failing the action''s lint step on GitHub-hosted runners.' +time: 2026-11-08T22:24:26.846058+01:00 From cb56f8c9b7c6b22dab9b502d4ee22aab108e6c4a Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:52:07 +0100 Subject: [PATCH 08/10] Dogfood the action in CI A local uses: ./ run executes the install step on a real hosted runner, where the version resolution and PATH wiring actually live. Both fixed bugs would have failed this job. --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 349d58d..167b9e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,6 +143,20 @@ jobs: echo "native=false" >> "$GITHUB_OUTPUT" fi + dogfood: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + # The action's install step has no unit-testable seam: it only + # exists on a real runner. Run the repo's own action at HEAD, with + # no version input, so a local ref installs the latest released + # gem and the lint step exercises the PATH wiring end to end. + - uses: ./ + with: + files: README.md + rules: runs-on: ubuntu-24.04 timeout-minutes: 10 From a8adf3e31b9ca4a8a144e7e20725221f9bbbfa19 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:54:47 +0100 Subject: [PATCH 09/10] Export GEM_HOME to the lint step as well The se bin stub resolves the gem through RubyGems paths, which do not include the temp GEM_HOME outside the install step. The dogfood job caught this: se was on PATH but the gem was not found. GITHUB_ENV carries the home forward. --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 5186ee5..3065e87 100644 --- a/action.yml +++ b/action.yml @@ -40,6 +40,9 @@ runs: gem install simple_english --no-document fi echo "$GEM_HOME/bin" >> "$GITHUB_PATH" + # The se bin stub resolves the gem through GEM_HOME, so the home + # must reach the Lint step, not just the bin dir. + echo "$GEM_HOME" >> "$GITHUB_ENV" - name: Lint id: lint shell: bash From c539a3abfeae4b31fe19612c68b1126721ce5f7f Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Sun, 8 Nov 2026 22:58:35 +0100 Subject: [PATCH 10/10] Write GITHUB_ENV in NAME=VALUE format The env file command rejects a bare value. The previous push failed the dogfood job at the install step. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3065e87..4b3c223 100644 --- a/action.yml +++ b/action.yml @@ -42,7 +42,7 @@ runs: echo "$GEM_HOME/bin" >> "$GITHUB_PATH" # The se bin stub resolves the gem through GEM_HOME, so the home # must reach the Lint step, not just the bin dir. - echo "$GEM_HOME" >> "$GITHUB_ENV" + echo "GEM_HOME=$GEM_HOME" >> "$GITHUB_ENV" - name: Lint id: lint shell: bash