From c21f4507a92591c5304be7cdb77c5369628530ad Mon Sep 17 00:00:00 2001 From: Unai Abrisketa Date: Mon, 16 May 2022 07:58:09 +0200 Subject: [PATCH] Add changes for v1 and documentation --- README.md | 25 ++++++++++++++++++++++++- action.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 action.yaml diff --git a/README.md b/README.md index 9142d9f..ada85b1 100644 --- a/README.md +++ b/README.md @@ -1 +1,24 @@ -### Team 42 Bundle run +# action-ruby-run + +GitHub Action for installing Ruby gems and running commands. It caches dependencies for reduced execution times. + +## Inputs + +| Name | Description | Default | Required | +|----------------------|------------------------------|---------|----------| +| `ruby_version` | The Ruby version to be used. | `3.1.2` | `true` | +| `cmd` | The command to be executed. | `nil` | `true` | +| `bundle_github__com` | The GitHub access token. | `nil` | `false` | + +## Usage + +```yml +jobs: + rubocop: + runs-on: ubuntu-latest + steps: + - uses: ePages-de/action-ruby-run@v1 + with: + ruby_version: 3.1.2 + cmd: bundle exec rubocop +``` diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..e732248 --- /dev/null +++ b/action.yaml @@ -0,0 +1,28 @@ +name: Run Ruby +description: Install Bundle gems and run commands. +author: Alket Tarko , Roberto Welzel Filho , Unai Abrisketa + +inputs: + ruby_version: + description: The Ruby version to be used. Defaults to `3.1.2`. + required: true + default: '3.1.2' + bundle_github__com: + description: The GitHub access token. + required: false + cmd: + description: The command to be executed. + required: true + +runs: + using: composite + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + env: + BUNDLE_GITHUB__COM: ${{ inputs.bundle_github__com }} + with: + ruby-version: ${{ inputs.ruby_version }} + bundler-cache: true + - shell: bash + run: ${{ inputs.cmd }}