-
Notifications
You must be signed in to change notification settings - Fork 1
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
ci(github): use single workflow for add/remove label #11
Conversation
WalkthroughThis pull request introduces a new input parameter Changes
Suggested reviewers
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
.github/workflows/github-label.yaml (1)
Line range hint
1-1
: Update workflow name to reflect its consolidated functionality.The workflow name
github-add-label
is now misleading since the workflow handles both adding and removing labels. Consider renaming it togithub-label-management
or similar.-name: github-add-label +name: github-label-management🧰 Tools
🪛 actionlint (1.7.4)
9-9: input "PRIMUS_REF" of workflow_call event has the default value "main", but it is also required. if an input is marked as required, its default value will never be used
(events)
🧹 Nitpick comments (1)
.github/workflows/github-label.yaml (1)
70-75
: Improve shell script robustness.The shell script could be improved to handle special characters and prevent word splitting.
- GH_REPOSITORY_NAME=$(echo "${GH_REPOSITORY}" | awk -F'/' '{print $2}') - $MAKE github-${GH_LABEL_ACTION}-label \ - GITHUB_ARGS="-t ${{ steps.token.outputs.token }} \ - -r ${GH_REPOSITORY_NAME} \ - -i ${GH_ISSUE_NUMBER} \ - -l '${GH_LABEL_NAME}'" + GH_REPOSITORY_NAME="${GH_REPOSITORY#*/}" + "$MAKE" "github-${GH_LABEL_ACTION}-label" \ + GITHUB_ARGS="-t '${{ steps.token.outputs.token }}' \ + -r '${GH_REPOSITORY_NAME}' \ + -i '${GH_ISSUE_NUMBER}' \ + -l '${GH_LABEL_NAME}'"Changes:
- Simplified repository name extraction using parameter expansion
- Added quotes around
$MAKE
to prevent word splitting- Added quotes around all arguments to handle special characters
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/github-label.yaml
(2 hunks).github/workflows/github-remove-label.yaml
(0 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/github-remove-label.yaml
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/github-label.yaml
65-65: shellcheck reported issue in this script: SC2086:info:6:14: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (3)
.github/workflows/github-label.yaml (3)
11-14
: LGTM! Well-documented input parameters.The new
GITHUB_LABEL_ACTION
input and updated descriptions for existing parameters clearly communicate the workflow's capabilities.Also applies to: 16-16, 21-21
Line range hint
33-58
: LGTM! Secure job configuration.The job configuration follows security best practices with:
- Appropriate runner selection
- Well-scoped permissions
- Secure token handling
🧰 Tools
🪛 actionlint (1.7.4)
65-65: shellcheck reported issue in this script: SC2086:info:6:14: Double quote to prevent globbing and word splitting
(shellcheck)
66-69
: LGTM! Robust input validation.The validation of
GH_LABEL_ACTION
ensures only valid operations are performed with a clear error message.
Signed-off-by: Prashant Shahi <[email protected]>
CI
Summary by CodeRabbit