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

Fix benchmark action for pull requests from forks #1315

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

siku2
Copy link
Member

@siku2 siku2 commented Jun 15, 2020

Description

The workflow currently doesn't work on pull requests because the GITHUB_TOKEN only has read-only permissions.
There seems to be no way to solve this currently so this PR removes the comment functionality entirely.
Instead, the results are now logged to the console which is less exciting but it should at least work.

Fixes #1311

Copy link
Contributor

@teymour-aldridge teymour-aldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this could be rewritten as two separate actions – one to run on push (with comments) and one to run on pull requests (without comments).

@siku2
Copy link
Member Author

siku2 commented Jun 15, 2020

@teymour-aldridge where would it post the comments on push though? It could add it as a comment to the commit itself but the commit should already be benchmarked before it is added to the master branch, right?

@teymour-aldridge
Copy link
Contributor

teymour-aldridge commented Jun 15, 2020

Oh, that's true. Perhaps a try/except sort of thing is possible in bash – so that it tries to add a comment, and if it lacks permission it will just log the output?
Disclaimer: my bash scripting is really bad.

@siku2
Copy link
Member Author

siku2 commented Jun 15, 2020

@teymour-aldridge I thought about this too, but how often is there going to be a pull request that doesn't originate from a fork?
It would be possible to do it by putting the affected steps behind a condition but I doubt it's worth the effort for such a rare case.

@teymour-aldridge
Copy link
Contributor

That's true. I've noticed that some Github apps are able to add comments for pull requests for third parties, but that would be something to look into for a later PR I think.

@siku2
Copy link
Member Author

siku2 commented Jun 15, 2020

I was curious about that too but I think they're all using integrated apps to do it.
I also looked into whether this affects #1307 and luckily it doesn't. Codecov has found an interesting way to solve this without depending on any secrets (see this comment for an explanation).

@jstarry jstarry merged commit 6c30068 into yewstack:master Jun 18, 2020
@siku2 siku2 deleted the benchmark-workflow branch June 18, 2020 13:39
teymour-aldridge pushed a commit to teymour-aldridge/yew that referenced this pull request Jun 20, 2020
* remove GITHUB_TOKEN

* no more need to escape the message
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

Successfully merging this pull request may close these issues.

Benchmark action fails to post comments for PRs from forks
3 participants