question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not seeing status checks despite passing LHCI_GITHUB_APP_TOKEN env

See original GitHub issue

Hi,

I’m trying to run lighthouse-ci as part of my Github Actions workflow. I’ve got a following step defined:

- name: Run Lighthouse CI
  run: |
    npm install -g @lhci/cli@0.3.x
    sh ./scripts/lighthouse-ci.sh
  env:
    LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

and here’s the lighthouse-ci script:

#!/bin/bash

yarn serve-ssr & npx wait-on http://localhost:3000/ping && lhci autorun \
  --upload.target=temporary-public-storage \
  --collect.url="http://localhost:3000/" \
  --collect.numberOfRuns=3

EXIT_CODE=$?
exit $EXIT_CODE

The job finishes successfully, and yet there are no status checks from lhci app on the pull request pages. The Lighthouse CI GitHub app is installed. Here’s the lhci output:

2020-01-07T11:08:08.1615866Z ##[group]Run npm install -g @lhci/cli@0.3.x
2020-01-07T11:08:08.1616571Z npm install -g @lhci/cli@0.3.x
2020-01-07T11:08:08.1616905Z sh ./scripts/lighthouse-ci.sh
2020-01-07T11:08:08.1650457Z shell: /bin/bash -e {0}
2020-01-07T11:08:08.1651111Z env:
2020-01-07T11:08:08.1651413Z   SSH_AUTH_SOCK: /tmp/ssh-auth.sock
2020-01-07T11:08:08.1654217Z   LHCI_GITHUB_APP_TOKEN: ***
2020-01-07T11:08:08.1654571Z ##[endgroup]
2020-01-07T11:08:20.6725461Z /opt/hostedtoolcache/node/12.13.0/x64/bin/lhci -> /opt/hostedtoolcache/node/12.13.0/x64/lib/node_modules/@lhci/cli/src/cli.js
2020-01-07T11:08:20.7986075Z + @lhci/cli@0.3.7
2020-01-07T11:08:20.7987248Z added 372 packages from 265 contributors in 12.174s
2020-01-07T11:08:21.2479204Z yarn run v1.19.2
2020-01-07T11:08:21.2922368Z $ node ./server/bootstrap.js
2020-01-07T11:08:28.6648453Z [11:08:28] WARN: build-info.properties not found
2020-01-07T11:08:38.8674730Z [11:08:38] INFO: Express server started on port 3000
2020-01-07T11:08:41.1089893Z ✅  .lighthouseci/ directory writable
2020-01-07T11:08:41.1093001Z ⚠️   Configuration file not found
2020-01-07T11:08:41.1818533Z ✅  Chrome installation found
2020-01-07T11:08:41.1824902Z Healthcheck passed!
2020-01-07T11:08:41.1890913Z 
2020-01-07T11:08:41.5886559Z Running Lighthouse 3 time(s) on http://localhost:3000/
2020-01-07T11:08:55.6706748Z Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
2020-01-07T11:08:55.6707696Z 
2020-01-07T11:08:55.6708622Z * Move code from componentWillMount to componentDidMount (preferred in most cases) or the constructor.
2020-01-07T11:08:55.6709336Z 
2020-01-07T11:08:55.6710135Z Please update the following components: LoadableComponent
2020-01-07T11:09:07.5682845Z Run #1...done.
2020-01-07T11:09:21.2047274Z Run #2...done.
2020-01-07T11:09:34.4405503Z Run #3...done.
2020-01-07T11:10:57.7562084Z Done running Lighthouse!
2020-01-07T11:10:57.7643052Z 
2020-01-07T11:10:59.1253930Z Uploading median LHR of http://localhost:3000/...success!
2020-01-07T11:10:59.1255873Z Open the report at https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/xxx.report.html
2020-01-07T11:11:00.8771080Z GitHub token found, attempting to set status...
2020-01-07T11:11:01.8443153Z GitHub accepted "success" status for "lhci/url/".
2020-01-07T11:11:03.3061416Z 
2020-01-07T11:11:03.3061848Z Done running autorun.

What am I doing wrong here?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
klapeccommented, Jan 8, 2020

@patrickhulce You’re right, the hashes don’t match. The script logs 589..., and the latest commit hash is actually 9d9.... I’ve added

with:
          ref: ${{ github.event.pull_request.head.sha }}

to the checkout action and now it works correctly. Thanks, been scratching my head because of this for way too long. 😃

5reactions
Yankovskycommented, Jun 15, 2020

Thanks, it worked perfectly! To help further developers the fix goes like that:

- uses: actions/checkout@v2
  with:
    ref: ${{ github.event.pull_request.head.sha }}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Github Action Status check missing from the list of checks in ...
I have the following github action setup that triggers fine on creation of Pull Request. But it does not show up ...
Read more >
The Required GitHub Status Check That Wasn't
Status checks can be added by external services to commits to signal issues. ... that must pass before allowing to merge pull requests....
Read more >
Enable required status checks for pull requests
In the search field, search for “VIP Code Analysis Bot” and select it in the results provided. This option will not be available...
Read more >
External status checks - GitLab Docs
GitLab does not prevent merging of merge requests that fail status checks. ... although if it persists, check the GitLab status page to...
Read more >
Status Checks - Codecov
true is specified the resulting status will pass no matter what the ... project in a monorepo and don't want to see status...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found