Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
iniva committed Jun 23, 2022
1 parent 1f99ad5 commit dc124c6
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,27 @@

- [Usage](#usage)
- [Inputs](#inputs)
- [(*) token](#-token)
- [PAT requirements](#pat-requirements)
- [DEBUG](#debug)

# Usage
> :information_source: Check the [ci workflow](.github/workflows/ci.yml) in this repo to see a live example on how to use this action in your own workflow
## Inputs
- `targetRepository`: Full name (`owner/repo-name`) of the repository that will receive the `repository_dispatch` event.
- required: `false`
- default: `${{ github.repository }}` (current repository running the workflow)

- `eventType`: Custom event type expected by the receiving repository
- required: `true`
- example: `'do-something-awesome'`

- `token`: A GitHub Personal Access Token (PAT) ([more info](#-token))
- required: `true`

- `payloadType`: Type of payload provided. Types: `string`, `path`, `url`
- required: `false`
- default: `'string'`

- `payload`: Stringified JSON payload. Expected when payloadType is not provided or provided as `"string"`
- required: `false`
- default: `'{}'`
- example: `'{"customField": "some value", "anotherField": "another value"}'`

- `payloadPath`: Path to file with JSON payload. Expected when payloadType is provided as `"path"`
- required: `false`

- `payloadUrl`: URL to JSON payload. Expected when payloadType is provided as `"url"`
- required: `false`

### (*) token
:information_source: If you are targeting:
- **Public repository**: The PAT only needs `public_repo` scope
- **Private repository**: The PAT needs `repo` scope and its owner needs `write` access in the target repository
| Input | Description | Required | Default | Comments |
|-|-|-|-|-|
| eventType | Custom event type expected by the receiving repository | :white_check_mark: | | **example**: `'do-something-awesome'` |
| token | A GitHub Personal Access Token (PAT) | :white_check_mark: | | [PAT requirements](#pat-requirements) |
| targetRepository | Full name (`owner/repo-name`) of the repository<br>that will receive the `repository_dispatch` event | :x: | `${{ github.repository }}` | **default**: current repository running the workflow |
| payloadType | Type of payload provided.<br></br>Types: `string`, `path`, `url` | :x: | `string` | -- |
| payload | Stringified JSON payload.<br>Expected when `payloadType` is not provided or provided as `"string"` | :x: | `'{}'` | **example**:<br>`'{"customField": "some value", "anotherField": "another value"}'` |
| payloadPath | Path to file with JSON payload.<br>Expected when `payloadType` is provided as `"path"` | :x: | | **example:** `path/to/valid.json` |
| payloadUrl | URL to JSON payload.<br>Expected when `payloadType` is provided as `"url"` | :x: | | **example:** `https://example.com/to/valid.json` |

## PAT requirements
:information_source: If you are targeting:
- **Public repository**: The PAT only needs `public_repo` scope
- **Private repository**: The PAT needs `repo` scope and its owner needs `write` access in the target repository

# DEBUG
To enable step debug logging, set the following secret in the repository that's running the workflow:
Expand Down

0 comments on commit dc124c6

Please sign in to comment.