Skip to content
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

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/label_approved_pull_requests.yml
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]
Comment on lines +3 to +5
Copy link
Contributor

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:

  1. When approvals are dismissed
  2. When PRs are updated after approval

Add these events to maintain label consistency:

 on:
   pull_request_review:
     types: [submitted]
+  pull_request:
+    types: [synchronize]

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.

Committable suggestion skipped: line range outside the PR's diff.


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
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

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:

  1. Adding a .gitattributes file:
+ *.yml text eol=lf
  1. Or running these git commands:
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)

Loading