Repository navigation
[Community] Fix PR labeling github action workflow - #6279
Merged
Merged
Conversation
TobKed
marked this pull request as draft
July 20, 2021 17:37
Contributor
Author
|
I will add description and then ping for reviews. |
Contributor
Great, thank you very much for your help! |
TobKed
marked this pull request as ready for review
July 21, 2021 16:17
Contributor
Author
|
I have updated description. Ready for review. |
Contributor
|
Thanks @TobKed , it works! |
2 of 4 tasks
Member
|
hi @TobKed, I am a developer from the Apache APISIX community and I have a similar question. |
Contributor
Author
Member
|
many thanks @TobKed , I will try. |
4 tasks
Member
|
Hi @TobKed .Are two action modules necessary? |
Contributor
Author
According to my knowledge they are necessary, however not sure if something change during last year :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_TOKENhas 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 reviewedtriggers another workflowLabel when approved workflow runwhich 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
xin the boxes that applyChecklist
Put an
xin 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.