gagoar / use-herald-action

GitHub action to add reviewers, subscribers, labels, and assignees to your PR. You can validate your PR template as well.
https://gagoar.github.io/use-herald-action/
MIT License
53 stars 7 forks source link

PEM routines:get_name:no start line #532

Open penguin02007 opened 1 year ago

penguin02007 commented 1 year ago

Hi, I'm trying to get UHA running in Github Cloud Enterprise.

I double checked the private key is in Repository secrets and the App is installed under Org level for permission.

What should I check next? Any help would be appreciated.

Run jnwng/github-app-installation-token-action@v[1](https://github.com/xxxl/xxx/actions/runs/3095721034/jobs/5010435933#step:2:1)
  with:
    appId: ***
    installationId: ***
    privateKey: ***

Error: error:0909006C:PEM routines:get_name:no start line
gagoar commented 1 year ago

Hey, @penguin02007 This issue seems to be that your privateKey is not properly generated. Did you follow the steps to create the App in your org?

I built a command line tool that might give you a hint. (it's what that action uses underneath)

You can run it on your computer and see what's going on. here is the project.

penguin02007 commented 1 year ago

@gagoar,

Yes i did indeed! image

I am on MacOS m1 12.6 and for some reason npm keep barks at me...

penguin02007$ npm -v
8.15.0
penguin02007$ npm cache clean --force
npm WARN using --force Recommended protections disabled.
penguin02007$ npm -g install github-app-installation-token
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/github-app-installation-token
npm ERR! dest /usr/local/lib/node_modules/.github-app-installation-token-l59W0We5
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/github-app-installation-token' -> '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5'
npm ERR!  [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/github-app-installation-token' -> '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/usr/local/lib/node_modules/github-app-installation-token',
npm ERR!   dest: '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ka.chan/.npm/_logs/2022-09-21T21_09_26_446Z-debug-0.log
gagoar commented 1 year ago

You have a problem in your computer. You are trying to install that package in a place you can't install. EACCESS is that.

sudo npm or you just do npx (you will have to have all the credentials in hand) like the example.

https://github.com/gagoar/github-app-installation-token#npx Gago Linux User #484680 http://scr.im/gagoar echo @.*** | sed 's/[SPAM]//g'

On Wed, Sep 21, 2022 at 5:11 PM Leo Chan @.***> wrote:

@gagoar https://github.com/gagoar,

Yes i did indeed! [image: image] https://user-images.githubusercontent.com/3166772/191590294-9c1cabc2-98cf-49a0-a6f9-3d84a84604ca.png

I am on MacOS m1 12.6 and for some reason npm keep barks at me...

penguin02007$ npm -v 8.15.0 penguin02007$ npm cache clean --force npm WARN using --force Recommended protections disabled. penguin02007$ npm -g install github-app-installation-token npm ERR! code EACCES npm ERR! syscall rename npm ERR! path /usr/local/lib/node_modules/github-app-installation-token npm ERR! dest /usr/local/lib/node_modules/.github-app-installation-token-l59W0We5 npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/github-app-installation-token' -> '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5' npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/github-app-installation-token' -> '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'rename', npm ERR! path: '/usr/local/lib/node_modules/github-app-installation-token', npm ERR! dest: '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/ka.chan/.npm/_logs/2022-09-21T21_09_26_446Z-debug-0.log

— Reply to this email directly, view it on GitHub https://github.com/gagoar/use-herald-action/issues/532#issuecomment-1254232256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXJ766SYISVBDJSWQFXPLV7N2YBANCNFSM6AAAAAAQRYAJSE . You are receiving this because you were mentioned.Message ID: @.***>

penguin02007 commented 1 year ago

Thanks for the tips @gagoar!

I have no luck using npm run or npm exec, it works perfectlynpx!

$ npm -g install github-app-installation-token

added 109 packages, and audited 110 packages in 5s

11 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

mbp:github-app-installation-token penguin02007$ npm run github-app-installation-token \
> --appId xxx --installationId xxx \
> --privateKeyLocation ~/Documents/uha_private_key.pem \
>
npm ERR! Missing script: "github-app-installation-token"
npm ERR!
npm ERR! Did you mean this?
npm ERR!     npm exec github-app-installation-token # run the "github-app-installation-token" command from either this or a remote npm package
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/penguin02007/.npm/_logs/2022-09-21T21_30_34_044Z-debug-0.log
mbp:github-app-installation-token penguin02007$ npx github-app-installation-token \
> --appId xxx \
> --installationId xxx \
> --privateKeyLocation ~/Documents/uha_private_key.pem \
>
💫 The token is: ghs_1234567890 and expires 2022-09-21T22:33:1Z ******
gagoar commented 1 year ago

Means that how you put the secrets in GitHub is not right. Also don't share the token in a public channel. Please edit the comment you left !