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 workflow cannot post comment to PR #298

Merged
merged 1 commit into from
Jun 25, 2022

Conversation

greenhandatsjtu
Copy link
Contributor

Fix: #294
I found benchmark workflow doesn’t work well that it fails to post comment to PR.
The reason is GITHUB_TOKEN only has read permission to pull requests when access by forked repos, so when a new PR is coming, running workflows only has read-only permission (of course not allowed to post comment). ref: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

Luckily, GitHub has introduced a new event type: pull_request_target, which allows to run workflows from base branch and pass a token with write permission, so we can use it to post benchmark results to PR (ref: https://github.community/t/github-actions-are-severely-limited-on-prs/18179/17).

I modify pull_request.yml to use pull_request_target, now it works well:
image

@casbin-bot
Copy link
Member

@smrpn @hackerchai @PsiACE @GopherJ please review

@codecov
Copy link

codecov bot commented Jun 25, 2022

Codecov Report

Merging #298 (1ccd8bd) into master (663e764) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #298   +/-   ##
=======================================
  Coverage   81.46%   81.46%           
=======================================
  Files          23       23           
  Lines        3463     3463           
=======================================
  Hits         2821     2821           
  Misses        642      642           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 663e764...1ccd8bd. Read the comment docs.

@PsiACE PsiACE merged commit e161068 into casbin:master Jun 25, 2022
kbalt pushed a commit to kbalt/casbin-rs that referenced this pull request Apr 12, 2023
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 workflow doesn’t work well
3 participants