Skip to content

Commit

Permalink
Merge pull request #347 from DEFRA/fix-for-universal-github-app-jwt-bump
Browse files Browse the repository at this point in the history
Fix for issue with private key no longer working as a buffer
  • Loading branch information
feedmypixel authored Jan 22, 2025
2 parents 20b77a0 + 26fe15a commit d06a20f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .jest/setup-env-vars.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {
clearMocks: true,
silent: false,
preset: '@shelf/jest-mongodb',
setupFiles: ['<rootDir>/.jest/setup-env-vars.js'],
testMatch: ['**/src/**/*.test.js'],
reporters: ['default', ['github-actions', { silent: false }], 'summary'],
collectCoverageFrom: ['src/**/*.js'],
Expand Down
5 changes: 4 additions & 1 deletion src/helpers/oktokit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { graphql as octokitGraphql } from '@octokit/graphql'

const auth = {
appId: config.get('github.app.id'),
privateKey: Buffer.from(config.get('github.app.privateKey'), 'base64'),
privateKey: Buffer.from(
config.get('github.app.privateKey'),
'base64'
).toString('utf8'),
installationId: config.get('github.app.installationId')
}

Expand Down

0 comments on commit d06a20f

Please sign in to comment.