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 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 diff --git a/README.md b/README.md index 20c7490..33ba118 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 00f8f3b..4b3c223 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,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