Closed B-Interactive closed 1 year ago
@dinhtungdu I'm guessing this is because the 10up/phpcs-json-to-md
project isn't published to npm, yeah?
@B-Interactive can you please share the configuration you're using so we can look at it further?
@jeffpaul I don't think so as in the example, we use github:10up/phpcs-json-to-md
to install the package directly from GitHub.
I use the same configuration (https://github.com/10up/wpcs-action#display-the-linting-result-in-the-github-actions-summary ) The same mistake
@dinhtungdu, this is the configuration I was using, that produced the error. It is a slightly modified version of the example here:
name: WPCS check
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
phpcs:
name: WPCS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: WPCS check
uses: 10up/wpcs-action@stable
with:
standard: 'WordPress'
extra_args: '--report-json=./phpcs.json'
- name: Update summary
run: |
npx --yes github:10up/phpcs-json-to-md --path ./phpcs.json --output ./phpcs.md
cat phpcs.md >> $GITHUB_STEP_SUMMARY
if: always()
@B-Interactive @WEBzaytsev thanks so much for your report, I can reproduce the issue on my local. Can you please try setting the node version to 14
to see if it fixes the issue? Look like people reported this this issue too: https://github.com/npm/cli/issues/5134
name: WPCS check
on: pull_request
jobs:
phpcs:
name: VIPCS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 14
- name: VIPCS check
uses: 10up/wpcs-action@stable
with:
standard: 'WordPress-VIP-Go'
extra_args: '--report-json=./phpcs.json'
- name: Update summary
run: |
npx github:10up/phpcs-json-to-md --path ./phpcs.json --output ./phpcs.md
cat phpcs.md >> $GITHUB_STEP_SUMMARY
if: always()
Thanks @dinhtungdu, that is working.
It did take more than 13 minutes at the Update summary step. I'm not sure if that's expected.
It did take more than 13 minutes at the Update summary step. I'm not sure if that's expected.
@B-Interactive It's definitely unexpected, the npx installation took so long. @jeffpaul I think we need to create a stable branch and push the built command there to speedup the installation.
@iamdharmesh Tung's note above might be something worth researching in your next spin through OSS time.
Hi @jeffpaul, npx
installation takes too long because of npm v6
(Node 14 comes with npm v6). I tried with Node 16 and it only takes 2s-4s
to Update the summary. Using Node 16 will fix this issue.
As npx
no longer works with github:
in latest version of Node 16 (As mentioned by @dinhtungdu here), We can use github:10up/phpcs-json-to-md
by install it (instead of using on-the-fly by npx) OR we can use specific node version(16.16.0) before this npx bug was introduced. Sample yml content is given below for both possible options.
Use node-version 16.16.0
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16.16.0
- name: WPCS check
uses: 10up/wpcs-action@stable
with:
standard: 'WordPress'
extra_args: '--report-json=./phpcs.json'
- name: Update summary
run: |
npx github:10up/phpcs-json-to-md --path ./phpcs.json --output ./phpcs.md
cat phpcs.md >> $GITHUB_STEP_SUMMARY
if: always()
OR
Use github:10up/phpcs-json-to-md
by install it (instead of using on-the-fly by npx)
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: WPCS check
uses: 10up/wpcs-action@stable
with:
standard: 'WordPress'
extra_args: '--report-json=./phpcs.json'
- name: Update summary
run: |
npm i -g github:10up/phpcs-json-to-md
phpcs-json-to-md --path ./phpcs.json --output ./phpcs.md
cat phpcs.md >> $GITHUB_STEP_SUMMARY
if: always()
I think we need to create a stable branch and push the built command there to speedup the installation.
@dinhtungdu @jeffpaul as this issue is with the old version of npm only, I think it's fine to keep 10up/phpcs-json-to-md
as it is, what do think?
Thanks
@iamdharmesh I think I'm in favor of the approach using github:10up/phpcs-json-to-md
.
Thanks for the feedback @jeffpaul PR raised for the same.
Describe your question
Using the Display the linting result in the GitHub Actions summary example, I was able to successfully set up an action that tests my repository.
However, it looks to be failing with a
404 Not Found
error when trying to convert JSON to MD, at the Job Summary creation step.Have I missed (or misunderstood) a step somewhere?
Code of Conduct