GithubHelp home page GithubHelp logo

Comments (5)

damccorm avatar damccorm commented on August 16, 2024

Looking at your linked PR, it looks like your use case is if you don't want to authenticate at all, right? I think I see a use case there, not sure if I see a use case for alternative auth methods - does that seem right?

from toolkit.

josephperrott avatar josephperrott commented on August 16, 2024

The use case I specifically am running into is needing to authentication with a JWT.

from toolkit.

ericsciple avatar ericsciple commented on August 16, 2024

I'm not sure whether we need to implement this.

The toolkit class is a thin wrapper convenience function for the common case GITHUB_TOKEN or PAT.

I could see the need if an input accepted a PAT or JWT and a function provided a single abstraction to do the right thing.

Otherwise I would recommend using the Octokit class directly.

Thoughts?

from toolkit.

eine avatar eine commented on August 16, 2024

IMHO, @actions/github should not duplicate or wrap any of the features provided by @octokit/rest, but extend them. Therefore, authentication and all regular operations should be done with octokit. When a feature from @actions/github is required, it should accept an existing octokit object as an argument. It should not be required for @actions/github to handle authentication at all. For example:

const octokit = new Octokit(getInput('token', { required: false }))
const ghkit = new github.GitHub(octokit)

instead of https://github.com/eine/issue-runner/blob/258088daba8c0e57368d08b2afbc5795cf282490/ts/main.ts#L39-L45

Moreover, it seems that the only addition of https://github.com/actions/toolkit/tree/master/packages/github is that it provides the context for the current action. Wouldn't it be easier if it did just that, instead of being a passthrough for all octokit features?

from toolkit.

ericsciple avatar ericsciple commented on August 16, 2024

fixed with #314 since the value of github.GitHub expanded to support runner proxy settings

now you can use a different auth mechanism, but still get the proxy settings.

from toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.