Use installation token for OS Botify#23760
Conversation
| - name: Generate a token | ||
| id: generate_token | ||
| uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c | ||
| with: | ||
| app_id: ${{ secrets.OS_BOTIFY_APP_ID }} | ||
| private_key: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }} | ||
| installation_id: ${{ secrets.OS_BOTIFY_INSTALLATION_ID }} |
There was a problem hiding this comment.
@roryabraham this is just a draft while I work through this but what are your thoughts about having the token generation be in this step as opposed to an independent job? I was having some trouble figuring out how to securely pass the output of the token into another job because github actions redacts/blanks it out due to it being a sensitive value. If it's in the same job, I can reference it via ${{ steps.generate_token.outputs.token }}
There was a problem hiding this comment.
So recall that setupGitForOSBotify is an action not a worklow, so it's always going to be scoped to just a single job (and by extension a single runner). So we shouldn't need or want to pass tokens between runners.
Does that answer your question?
There was a problem hiding this comment.
Sort of. Are you suggesting we move this step into setupGitForOSBotify then? And if we do that, how do we use that token in these next steps instead of the under the hood GITHUB_TOKEN the jobs use?
The part I think I'm missing is how we access an output from one action outside of it in another step?
There was a problem hiding this comment.
Ok, I think I figured it out and got a little further. Long story short, order of operations matters here because we're flipping between the action token used in the job and the new token for OS Botify
https://github.com/Expensify/App/actions/runs/5686198797/job/15412567692
I think I'm getting this next error because I need to allow OS Botify App to override our branch protections and push to main.
|
@robertKozik @ One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Co-authored-by: Andrew Gable <andrew@expensify.com>
|
Pushed @AndrewGable's suggested change and retested here https://github.com/Expensify/App/actions/runs/5728276127/job/15522468403 |
|
Yeah I thought maybe start here and make sure it works then update others? |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
|
Will let you self-merge when you're ready to live-test |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/justinpersaud in version: 1.3.50-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.50-3 🚀
|
|
🚀 Deployed to staging by https://github.com/justinpersaud in version: 1.3.51-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.51-2 🚀
|

Details
Switch our actions jobs to use an installation token instead of PAT
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/299601
PROPOSAL:
Tests
https://github.com/Expensify/App/actions/runs/5717994375/job/15492912210
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android