Skip to content

add implementation of permissions inputs - #217

Merged
parkerbxyz merged 18 commits into
actions:permissions_inputsfrom
gr2m:permissions_inputs
Mar 25, 2025
Merged

add implementation of permissions inputs#217
parkerbxyz merged 18 commits into
actions:permissions_inputsfrom
gr2m:permissions_inputs

Conversation

@gr2m

@gr2mgr2m commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

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 a team and parkerbxyz as code ownersMarch 20, 2025 18:03

@gr2mgr2m left a comment

Copy link
Copy Markdown
ContributorAuthor

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

Comment threadtests/main.js Outdated
Comment threadtests/snapshots/index.js.md Outdated
Comment threadREADME.md Outdated
Comment threadtests/snapshots/index.js.md Outdated
Comment threadtests/snapshots/index.js.md Outdated

@gr2mgr2m left a comment

Copy link
Copy Markdown
ContributorAuthor

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.

Comment threadmain.js
main(
const permissions = getPermissionsFromInputs(process.env);

export default main(

Copy link
Copy Markdown
ContributorAuthor

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.

@parkerbxyzparkerbxyz left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadCONTRIBUTING.md Outdated
Comment threadCONTRIBUTING.md Outdated
Comment threadREADME.md Outdated
gr2mand others added 3 commits March 24, 2025 20:59
Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
@gr2m

gr2m commented Mar 25, 2025

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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$FOOBARHello World!

Syntax highlighting with shell:

>echo$FOOBAR
Hello World!

@parkerbxyz
parkerbxyz merged commit 7bc649b into actions:permissions_inputsMar 25, 2025
@gr2mgr2m mentioned this pull request Mar 25, 2025
5 tasks
Sign up for freeto 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

@gr2m@parkerbxyz