-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed client_payload as json to overcome 10 top-level properties limit #204
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -79,6 +79,27 @@ jobs: | |||||
dispatch_event_type: my-project-release | ||||||
``` | ||||||
|
||||||
If your event has **more than 10** top-level properties, you can embed it in a JSON string `{"event_payload":"<payload_as_json_string>"}` to overcome Github api limits. | ||||||
|
||||||
```yml | ||||||
name: Release Notification | ||||||
on: | ||||||
release: | ||||||
types: | ||||||
- published | ||||||
|
||||||
jobs: | ||||||
notify: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: gr2m/release-notifier-action@v1 | ||||||
with: | ||||||
app_id: ${{ secrets.APP_ID }} | ||||||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||||||
dispatch_event_type: my-project-release | ||||||
embed: true | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I would prefer to make it even more explicit and call it |
||||||
``` | ||||||
|
||||||
## How it works | ||||||
|
||||||
Each time you create, edit, or delete a release on your repository, the action will load all installations using the credentials you provided. For each installation, the action dispatch creates a [repository dispatch event](https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-repository-dispatch-event) and sets the event type to what you configured in `inputs.dispatchEventType`. | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,10 @@ inputs: | |
dispatch_event_type: | ||
description: "The name of the repository dispatch event, see https://git.io/JTpRo. Defaults to '[owner]/[repo] release', e.g. 'gr2m/release-notifier-action release'" | ||
required: false | ||
embed_payload: | ||
description: "Instead of event_payload, use a syntetic event object with payload embedded as JSON string, e.g. '{event_payload:<payload_as_json_string>}" | ||
required: false | ||
default: "false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't set any value as default for optional boolean inputs, it could easily be interpreted as the string "false" which might be interpreted as truthy if not careful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, will update PR and remove default value. |
||
runs: | ||
using: "node16" | ||
main: "dist/index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I learned about the 10 top level limit! Is this documented somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, here's the link https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event