Skip to content
Merged
2 changes: 1 addition & 1 deletion .changes/unreleased/Fixed-20261108-215904.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .changes/unreleased/Fixed-20261108-222426.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ 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
```

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)

```bash
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,6 +39,10 @@ runs:
else
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=$GEM_HOME" >> "$GITHUB_ENV"
- name: Lint
id: lint
shell: bash
Expand Down
Loading