Open qgustavor opened 2 years ago
@qgustavor what issues are you having?
npx pr-release actions-yml
You are good to go. If you are using pnpm you'll need to do things a little different.
Is because I messed up publishing a package yesterday and I want to use pr-release to reduce the chance of it happening again. Since I messed up yesterday I want to be sure to do the correct thing now.
Running npx pr-release actions-yml
is the first step in the readme, the seventh step in the website and the second step in the comment above. From what I understand it's just "set up tokens, set up branches, call npx command, the order doesn't matter too much", right?
In this page it says "This requires the ability for pr-release to circumvent normal push rules, so an admin environment variable is required." Is it still true after this change in GitHub?
Edit: Looks like the readme - i.e. calling the command first - is easier since I don't want to set up branches and have to call the command that set the workflows in a feature branch, it takes more steps. So I tried calling the command: nothing in the repository got changed many times. In every try it returned the following and nothing else - no error message, no success message, nothing:
$ npx pr-release actions-yml
Need to install the following packages:
pr-release@0.18.20
Ok to proceed? (y) y
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
Hey @qgustavor good points made.
From what I understand it's just "set up tokens, set up branches, call npx command, the order doesn't matter too much", right?
Yeah the order isn't super important, thought I'd set up the tokens/branches first just so they are there before github actions runs. If they aren't the CI job might fail, but that is ok too.
So I tried calling the command: nothing in the repository got changed many times. In every try it returned the following and nothing else - no error message, no success message, nothing:
That is suspicious, and definitely a bug if that's the case. It should create some yml files in your .github/workflows
folder in your repo. Unfortunately I won't have time to try and repro for a few days. But if the files really aren't being created then you can create your own based on the templates here: https://github.com/JAForbes/pr-release/tree/next/.github/workflows
In this page it says "This requires the ability for pr-release to circumvent normal push rules, so an admin environment variable is required." Is it still true after this change in GitHub?
It may not be the case anymore, would love if someone could test that out and get back to me. :)
I hope you figure it out, if not, I'll definitely get back to this issue in a few days and see if I can reproduce your issue.
Generally having a consistent set of steps on the website / readme would be better, so I'll definitely look into that, also PRs welcome 👍
Hey @qgustavor I just tried to repro on Node v16.15.0 and the command worked. But then I jumped into a docker container and ran the same thing there with node:16-alpine and I got the exact behaviour you described.
In fact even npx pr-release --help
printed nothing out.
So I expect there's an environment specific issue with the bin.js execution that I wasn't aware of before, thanks for bringing this to my attention :)
Could you let me know as much detail about your machine/environment. Also if you want a work around in the meantime I expect this will work:
npm install pr-release -D
node node_modules/pr-release/bin.js actions-yml
Also after installing, npx pr-release
will preference your local copy, so it'd be interesting to know what this does on your machine:
npm install pr-release -D
npx pr-release --help
Once this issue is fixed I recommend uninstall pr-release and always using the latest via npx, but its likely to be a good workaround in the meantime.
My theory is the shebang at the top of the bin file doesn't work on your machine:
#! /usr/bin/env node
import { main } from './lib/index.js'
main()
Would you be able to run this in your terminal and let me know what you get back:
/usr/bin/env node --version
And also:
which node
Apologies for this not working out of the box @qgustavor, hopefully we can get you back on track soon.
Last time I commented I tried running in v18.4.0 on Windows and in on v14.17.2 Debian (WSL 1). I updated both to v18.8.0 and ran again: now it worked. Weird. 😕
Edit: I use nvm and nvm-windows to handle updating. The first places Node.js at /usr/bin/node
and the second at C:\Program Files\nodejs\node.exe
.
Ok cool, well I'll keep this open to normalize the quick start / website discrepancies. And I'll make a new issue to investigate why the cli doesn't work in some envs.
The Quick Start sections in the readme and in the website are a bit different from each other. What are the recommended steps?