Skip to content

add implementation of permissions inputs #217

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

Merged
merged 18 commits into from
Mar 25, 2025

Conversation

gr2m
Copy link
Contributor

@gr2m gr2m commented Mar 20, 2025

This is ready for review now.

Our tests now log out each request, including request body for the POST request to create an installation access token. That way it becomes part of our snapshot and we can verify that the correct requests are being sent.

I don't like the way I implemented the logging, it's manually on every .intercept() call. And I had to use a hack with a once() helper method because the body() and path() callbacks get invoked twice by undici for some reason. Ideally there would be a way to add a "request" listener and just log that out, I'll ask the undici folks if there is a way, I couldn't find any.

Anyway, this is now good for merging

@gr2m gr2m requested review from parkerbxyz and a team as code owners March 20, 2025 18:03
Copy link
Contributor Author

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

I think we can merge this one in already, and continue next week investigating the double requests in the snapshots

Copy link
Contributor Author

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

This is good to go.

main(
const permissions = getPermissionsFromInputs(process.env);

export default main(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are exporting the promise returned by main() for testing. We need to await the execution in order to snapshot all requests that were sent by it.

Copy link
Contributor

@parkerbxyz parkerbxyz left a comment

Choose a reason for hiding this comment

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

Thanks so much, @gr2m! ✨ I left a few minor suggestions for your consideration.

gr2m and others added 3 commits March 24, 2025 20:59
Co-authored-by: Parker Brown <[email protected]>
Co-authored-by: Parker Brown <[email protected]>
Co-authored-by: Parker Brown <[email protected]>
@gr2m
Copy link
Contributor Author

gr2m commented Mar 25, 2025

let's ship it 👍🏼

What's the benefit of using console for code snippets?

```console

I have never seen that used before

@parkerbxyz
Copy link
Contributor

What's the benefit of using console for code snippets?

```console

I have never seen that used before

It adds syntax highlighting. You can use sh-session or console for command line snippets, which will display differently than shell or bash, which are better suited for scripts.

No syntax highlighting:

> echo $FOOBAR
Hello World!

Syntax highlighting with console:

> echo $FOOBAR
Hello World!

Syntax highlighting with shell:

> echo $FOOBAR
Hello World!

@parkerbxyz parkerbxyz merged commit 7bc649b into actions:permissions_inputs Mar 25, 2025
2 checks passed
@gr2m gr2m mentioned this pull request Mar 25, 2025
5 tasks
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.

2 participants