Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on GitHub Actions? #348

Open
gr2m opened this issue Sep 20, 2019 · 14 comments
Open

Not working on GitHub Actions? #348

gr2m opened this issue Sep 20, 2019 · 14 comments

Comments

@gr2m
Copy link

gr2m commented Sep 20, 2019

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

Bug

What is the current behavior?

When running npx bundlesize in a GitHub Action, I get this warning:

WARN github token not found

You are missing out on some cool features.
Read more here: https://github.com/siddharthkp/bundlesize#2-build-status

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

See output log at See https://github.com/octokit/rest.js/runs/230268601#step:6:6

Configuration:

https://github.com/octokit/rest.js/blob/7e7319208b77cf83eb4c6335c03325befc38901f/.github/workflows/bundlesize.yml#L15-L17

I first had BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} but then changed it to BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }} with the token provided via the OAuth app.

What is the expected behavior?

It should just work ™️

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

Please mention other relevant information.

  • node version: 12.10.0
  • npm version: version distributed with Node 12.10.0
  • Operating system: Ubuntu latest
  • bundlesize version: latest, run via npx
  • CI you are using: GitHub Actions
@gr2m
Copy link
Author

gr2m commented Sep 20, 2019

By the way I'm a maintaner at https://github.com/probot/probot and the JavaScript/Node tools at https://github.com/octokit/, if you have any questions or ideas you would like to discuss regarding integrating with any parts of the GitHub APIs, I'm happy to help

@Andarist
Copy link
Contributor

It seems to work pretty OK with GitHub Actions for me - redux-saga/redux-saga#1952 . Still need to figure out few things regarding actions, but bundlesize's setup is not a problem for me there.

@jackyef
Copy link

jackyef commented Oct 18, 2019

@Andarist From what I see in your repo, the bundlesize cli is making request to the bundlesize server, but it is getting 500 error response. Is that an expected thing? I am running into the same problem in my repo: jackyef/bundlesize-gh-action#1

@Andarist
Copy link
Contributor

@jackyef where you can see the error? That branch is currently having problems with test script and it doesn't reach the bundlesize step. When it did reach it in the past I haven't seen any problems - the check was green, size reported etc.

@jackyef
Copy link

jackyef commented Oct 19, 2019

@Andarist
Copy link
Contributor

Interesting - this one https://github.com/redux-saga/redux-saga/commit/a91fe2e6aef8a9bc532e2711b65992e9bc0a59cb/checks?check_suite_id=263313078 has errored OK on the bundlesize check and I remember seeing the status under my PR.

Currently, I'm having problems with yarn/npm running with different node paths - that's why I haven't merged in that PR yet, but gonna look into fixing this and maybe then I'll see what exactly happens with bundlesize.

@jackyef
Copy link

jackyef commented Oct 19, 2019

Hmm, okay so it did work for you. I thought it was a case of a bad implementation in my part.

Now, I assume that the server (https://bundlesize-store.now.sh/) is currently having issue?

cc: @siddharthkp

@siddharthkp
Copy link
Owner

Ugh, yeah. bundlesize-store has been really flaky recently. There are a bunch of problems in how I first implemented in 2 years ago. I'm probably going to rewrite it in November

your patience would be great 😄

@jackyef
Copy link

jackyef commented Oct 20, 2019

Ah, I see! Anything we can do to help? @siddharthkp

@siddharthkp
Copy link
Owner

siddharthkp commented Oct 20, 2019

You could take up some of the tasks involved in writing that, but that would also take up some effort from my side to get you started

so for a few weeks, please just wait without booing at me 😅

@Djiit
Copy link

Djiit commented Jan 23, 2020

Hey @siddharthkp , could we kickstart the development with the volunteers around ? Thanks 🙏

@jackyef
Copy link

jackyef commented Feb 4, 2020

@Djiit He seems to have too much on his plate at the time 😄

For the time being, I think bundlewatch is a great alternative. I made an action for it as well to make it a little bit easier to use. bundlewatch-gh-action

@patcon
Copy link

patcon commented Jun 23, 2020

Not sure why, and I think this is still a bug, but I think the simplest resolution here is to use on: push instead of on: pull_request -- it will still show up as a status check on PRs.

Broken pull_request: https://github.com/octokit/rest.js/actions/runs/12676607/workflow
Working push: https://github.com/redux-saga/redux-saga/pull/1952/files

I did some testing with GitHub Actions, and changing the trigger event was the exact place where it broke in many specific tests.

@gr2m
Copy link
Author

gr2m commented Jun 23, 2020

on: push will not work for pull requests coming from forks

Basically you have to make it work without requiring a GitHub token, as repository secrets are not passed to pull requests from forks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants