-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[ISSUE #1590]Add Label approved pull requests action #1591
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Label approved pull requests | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
labelWhenApproved: | ||
name: Label when approved | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Label when approved | ||
uses: pullreminders/label-when-approved-action@master | ||
env: | ||
APPROVALS: "1" | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ADD_LABEL: "approved" | ||
#REMOVE_LABEL: "" | ||
Comment on lines
+1
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix line endings The file uses incorrect line ending characters. This can cause issues when the workflow runs on different operating systems. Please ensure all line endings are normalized to LF (\n). You can fix this by:
+ *.yml text eol=lf
git config --global core.autocrlf input
git rm --cached -r .
git reset --hard 🧰 Tools🪛 yamllint (1.35.1)[error] 1-1: wrong new line character: expected \n (new-lines) [error] 17-17: trailing spaces (trailing-spaces) |
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.
🛠️ Refactor suggestion
Consider additional trigger events for label consistency
The current trigger configuration might lead to stale labels in certain scenarios:
Add these events to maintain label consistency:
Also consider using a more comprehensive action that handles these cases automatically, such as
actions/label-approved-pulls@v1
which maintains label consistency across PR updates and approval dismissals.