-
Notifications
You must be signed in to change notification settings - Fork 0
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
Demystifying GitHub Apps: Using GitHub Apps to Replace Service Accounts | josh-ops #17
Comments
Hi Josh, firstly, thanks for this post. I was looking for the solution that you mentioned in problem statement and I found this post. But, I would like to install this bot or app on our GH Enterprise server, so is using smee.io for this purpose safe ? if not, how can I use this approach. Please advise. |
Hey @maheshglm! I just modified this post slightly to be more clear. You don't have to use smee.io, smee.io is only used to help you with examining the webhook payloads. And you bring up a good point, you shouldn't use smee.io for production purposes:
I made it more clear that you can grab the Installation ID of your App by simply looking at the URL after you installing the app 😄 . See the updated post and extra screenshot! |
Hi Josh, Thank you very much for the quick response. It's clear now. |
Extremely useful post - thank you Josh! 👏 |
Hi, Excellent post! Thanks.
|
@ranouf ahh very sadly, GitHub Apps cannot be used to download/restore packages :(
It is a little confusing b/c if you look at the Packages APIs, they say they work with Apps, but that's just for listing packages, deleting, etc. The way to do this today is to use the "Manage Actions access" functionality and add the repo(s) you're running Actions in there. |
To get rid of PAT token completely you can make use of the access-token action You just need to install the GitHub Access Manager App, create (You could also self-host the GitHub App server part on you own) Usage example name: GitHub Actions Access Manager Example
on:
workflow_dispatch:
push:
branches:
- main
jobs:
checkout:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: qoomon/actions--access-token@v3
id: access-token
with:
repository: <TARGET_REPO>
permissions: |
contents: read
- uses: actions/checkout@v4
with:
repository: <TARGET_REPO>
token: ${{ steps.access-token.outputs.token }} |
Oh that's cool! I will have to try that out. Thank you for sharing @qoomon 🙇 |
@joshjohanning Looking forward to get some feedback, especially from a security perspective. |
Hi Josh, are you saying that the best practices would be to use github apps vs SAs or Tokens? |
@udaygovindarajula1 It does depend on what you're doing slightly, but generally, yes! A GitHub App doesn't use a license whereas a "service account user" would. You don't have to manage the username/password/mfa settings with a GitHub App either (just the PEM file, and you can always rotate that if you lose it). Also, GitHub Apps have a higher rate limit than PATs. The main things that I can think of that a GitHub App cannot do are 1) download/access packages from GitHub Packages and 2) run GitHub Enterprise Importer (GEI) for migrations. |
Demystifying GitHub Apps: Using GitHub Apps to Replace Service Accounts | josh-ops
Creating no-code GitHub Apps to install to an organization to replace having to create service accounts or a user PAT for authorization in GitHub Actions
https://josh-ops.com/posts/github-apps/
The text was updated successfully, but these errors were encountered: