Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

boyander
Copy link

@boyander boyander commented Oct 4, 2023

Added option to overcome github limits by embedding event as json string.

action.yml Outdated
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"
Copy link
Owner

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, will update PR and remove default value.

README.md Outdated
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
dispatch_event_type: my-project-release
embed: true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
embed: true
embed_payload: true

I would prefer to make it even more explicit and call it embed_payload_as_json_string

@@ -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.
Copy link
Owner

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought, the user does not have control about the event payload, it's just the release event payload. I have not seen this problem happen before, do you have a way to reliably reproduce it?

@boyander
Copy link
Author

boyander commented Oct 5, 2023

Not sure on how to reliably reproduce it. I've found the issue while using your action, just the same way ts being used in https://github.com/octokit/openapi-types.ts/blob/main/.github/workflows/release-notification.yml

Maybe you are running against enterprise API. Any ideas?

@boyander
Copy link
Author

boyander commented Oct 5, 2023

PR updated :)

@gr2m
Copy link
Owner

gr2m commented Oct 8, 2023

I would still like to reproduce it somehow. Maybe we can avoid adding the new option altogether and instead dropping some keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants