-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Community] Fix PR labeling github action workflow #6279
Conversation
I will add description and then ping for reviews. |
Great, thank you very much for your help! |
I have updated description. Ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @TobKed , it works! |
hi @TobKed, I am a developer from the Apache APISIX community and I have a similar question. |
Hi @tzssangglass , I am happy to help you. Edit: I've checked apache/apisix#6136 and I think the problem which you relates to there is solved here as well: important thing here is that labelling consists of two workflows:
where first one just triggers second one. Reason for that is described here: Preventing pwn requests. In your case you may need to adjust permissions (https://github.com/apache/incubator-doris/blob/c2520c878c3d827e27c32f1dab5e5953a25b52e7/.github/workflows/approve-label.yml#L24). This article may be helpful: Permissions for the GITHUB_TOKEN |
many thanks @TobKed , I will try. |
Hi @TobKed .Are two action modules necessary? |
According to my knowledge they are necessary, however not sure if something change during last year :) |
Proposed changes
My change is the fix and improvement for github action which labels approved PRs (introduced in this PR).
It is inspired by solution introduced and tested in Apache Airflow (thanks @potiuk @ashb 🚀 )
Corresponding Apache Airflow workflows on which I based this PR:
Problems which were solved in this PR:
Permissions.
@morningman opened a related bug: [Help] Error: Resource not accessible by integration. It is related to limited permissions of workflows being triggered by
pull_request_review
(GITHUB_TOKEN
has read-only permissions). More information about it you can find in the article: Keeping your GitHub Actions and workflows secure: Preventing pwn requests.TL;DR: On pull request review event (
on: pull_request_review
) "dummy" workflowLabel when reviewed
triggers another workflowLabel when approved workflow run
which has sufficient permissions (on: workflow_run: workflows: ["Label when reviewed"]
).Safe use of 3rd-party Github Actions by using submodules pattern. It is decribed in:
https://cwiki.apache.org/confluence/display/BUILDS/GitHub+Actions+status
This pattern is successfully used by projects like:
Types of changes
What types of changes does your code introduce to Doris?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.