Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MeilCli committed Mar 13, 2020
1 parent 8c1bc47 commit 159d487
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,30 @@ on:
jobs:
danger:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' # if only run pull request when multiple trigger workflow
steps:
- uses: actions/checkout@v1
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- uses: MeilCli/danger-action@v2
with:
plugins_file: 'Gemfile'
danger_file: 'Dangerfile'
danger_id: 'danger-pr'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
# ↓↓↓ if using bundle cache when danger plugins install ↓↓↓
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }} # change your gemfile path
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle config
run: bundle config path vendor/bundle
# ↑↑↑ if using bundle cache when danger plugins install ↑↑↑
- uses: MeilCli/danger-action@v3
with:
plugins_file: 'Gemfile'
danger_file: 'Dangerfile'
danger_id: 'danger-pr'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
- if multiple trigger workflow, use if condition `if: github.event_name == 'pull_request'`
- example is [this repository's workflow](.github/workflows/build.yml)
## input
- `danger_version`
Expand All @@ -42,13 +51,17 @@ jobs:
- default: `>= 6.0.0`
- `plugins_file`
- optional
- gemfile path for danger plugin
- gemfile path for danger plugin. if set plugins_file, action do not exec `gem install danger`
- `danger_file`
- required
- dangerfile path for running danger
- `danger_id`
- required
- danger id is an identifier string, example(`danger-pr`, `danger-CI`, etc..)
- `fail_on_stderr_when_danger`
- optional
- action fail when danger output stderr
- default: `false`

## env
- `DANGER_GITHUB_API_TOKEN`
Expand Down

0 comments on commit 159d487

Please sign in to comment.