-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add GitHub App API token authentication to clone custom policy inside a private repository #51
Conversation
Hi @GeekMasher, Hope you are doing well! First, thank you for this great tool! I don't know if you have seen this PR, but it might be really useful for me and my company to get this feature directly in the tool. The changes are minor, and could help us to use a GitHub App token instead of a classic GitHub API token. Thank you in advance, Théo |
@4bg0P Thank you for the PR and Issue raised. I'll take a look later today or tomorrow and merge the changes. I will have to create an Issue for the documentation request after merging as docs are still in the |
@GeekMasher Thank your for your answer! Do not hesitate to reach me if you need more details, or need me to help you with the documentation. Have a great day! 😄 |
@@ -30,7 +30,8 @@ | |||
parser.add_argument("--disable-dependabot", action="store_true") | |||
parser.add_argument("--disable-dependency-licensing", action="store_true") | |||
parser.add_argument("--disable-dependencies", action="store_true") | |||
parser.add_argument("--disable-secret-scanning", action="store_true") | |||
parser.add_argument("--disable-secret-scanning", action="store_true") | |||
parser.add_argument("--is-github-app-token", action="store_true", default=False) |
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.
@4bg0P Do you think that this argument should / could be set via the Actions?
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.
inputs: |
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.
@GeekMasher Sure, it is a great idea to set it using Actions also!
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.
I'll add this as an upcoming update
Main is failing due to the PAT used so the E2E tests are failing. Everything else looks good so merging. |
… a private repository (GeekMasher#51) * Add GitHub App authentication
As stated in issue #50, the custom policy clone using GitHub App API token is not possible as
x-access-token
username need to be set in thehttps
clone link.I've added an optionnal argument
--is-github-app-token
to specify if the authentication token is a GitHub App API token, and set thex-access-token
username needed to clone the policy.I've also added the
branch
argument toPolicy()
call, as it was actually never used.