Skip to content

Commit

Permalink
feat: now pizza-cli runs via npx pizza (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline authored Sep 19, 2024
1 parent ead4b34 commit 04485b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Pizza Action
uses: open-sauced/pizza-action@v2.2.0
uses: open-sauced/pizza-action@latest
with:
# optional and default is "latest". Add this parameter if you want to use a specific version, e.g. v2.0.0
cli-version: "v2.2.0"
Expand All @@ -44,14 +44,11 @@ The pizza CLI's "generate codeowners ./ --tty-disable" command requires a full r

### `cli-version`

The version of the pizza CLI to use. Default is `latest`. If using a numbered version, make sure to prefix the version number with `v`. For example, `v2.0.0`.
The version of the pizza CLI to use. Default is `latest`. If using a numbered version, make sure to prefix the version number with `v`. For example, `v2.2.0`.

### `pizza-args`

Arguments to pass to the pizza CLI. Default is `generate codeowners /repository --tty-disable`.

> [!NOTE]
> `/repository` is the path to the repository root where the pizza-cli will be run in Docker.
Arguments to pass to the pizza CLI. Default is `generate codeowners ./ --tty-disable`.

### `commit-and-pr`

Expand Down
12 changes: 2 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
required: false
pizza-args:
description: "OpenSauced Pizza CLI command to run"
default: "generate codeowners /repository --tty-disable"
default: "generate codeowners ./ --tty-disable"
required: false
commit-and-pr:
description: "Commit and push changes"
Expand All @@ -29,16 +29,8 @@ runs:
with:
fetch-depth: 0

- name: Set up Docker image
run: echo "DOCKER_IMAGE=ghcr.io/open-sauced/pizza-cli:${{ inputs.cli-version }}" >> $GITHUB_ENV
shell: bash

- name: Check pizza CLI version
run: docker run ${{ env.DOCKER_IMAGE }} version
shell: bash

- name: Run pizza CLI command
run: docker run -v ./:/repository ${{ env.DOCKER_IMAGE }} ${{ inputs.pizza-args }}
run: npx --yes pizza@${{ inputs.cli-version }} ${{ inputs.pizza-args }}
shell: bash
working-directory: ${{ github.workspace }}

Expand Down

0 comments on commit 04485b4

Please sign in to comment.