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.

Bundlewatch Github status not working?

See original GitHub issue

Do you want to request a feature or report a bug?

Bug.

(Slack link above not working btw)

What is the current behavior?

Unable to get Github status check to work with Github actions.

If the current behavior is a bug, please provide the steps to reproduce.

Following the official documentation.

  1. Install bundlewatch.
  2. Create config file.
  3. Add BUNDLEWATCH_GITHUB_TOKEN secret to the project.
  4. Add build command and bundlewatch CLI command to my existing Github Actions workflow.
  5. Commit these changes.
  6. Observe everything works and results are saved.
  7. Open a new pull request.
  8. Observe everything works again and the results are diffed against the base branch.
  9. Observe no status check appears on the pull request.

package.json

"size": "bundlewatch --config .bundlewatchrc.json"

.bundlewatchrc.json

{
  "files": [
    {
      "maxSize": "20 KB",
      "path": "build/static/js/*.js"
    }
  ],
  "ci": {
    "trackBranches": ["main"]
  }
}

.github/workflows/workflow.yml

name: workflow

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  webapp:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.1
      - run: yarn install --frozen-lockfile
      - run: yarn build
      - run: yarn size
        env:
          BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
          CI_BRANCH_BASE: main

What is the expected behavior?

A failing or succeeding pull request check appears on Github.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, bundlewatch version, and Operating System.

Node 12.18.3 bundlewatch 0.2.7

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
izi-pcommented, Jan 20, 2021

Somehow it does not work with github actions and the commit that is sent to result page is a weird merge commit instead of the head commit of the pull request.

I managed to fix this by passing manually the commit sha pointing to the head commit of the pull request in my github action

checksize.yml

      - name: Run bundlewatch
        run: yarn bundlewatch --config bundlewatch.config.json
        env:
          BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
          CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}

cc @sjwilczynski

5reactions
alexcrooxcommented, Jan 20, 2021

Time for another fork? 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · bundlewatch/bundlewatch - GitHub
Bundlewatch throws an exception if there is no package.json in the current directory. ... Bundlewatch Github status not working? ... ProTip! What's ...
Read more >
Issues · bundlewatch/bundlewatch · GitHub
Bundlewatch throws an exception if there is no package.json in the current directory. ... Bundlewatch Github status not working? ... ProTip! Adding no:label...
Read more >
bundlewatch - npm
Start using bundlewatch in your project by running `npm i bundlewatch`. There are 3 other projects in the npm registry using bundlewatch.
Read more >
bundlewatch - UNPKG
66, BundleWatch can report its status on your GitHub Pull Requests. ... /><a href="https://github.com/bundlewatch/bundlewatch/issues?q=author%3Apascaliske" ...
Read more >
bundlesize - Bountysource
Bundlewatch Github status not working? $ 0. Created 2 years ago in bundlewatch/bundlewatch with 7 comments. Do you want to request a feature...
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