chore: Lowercase GitHub Labels

This commit is contained in:
Rajarshee Chatterjee
2026-09-22 23:33:34 +05:30
parent c2c1658d1f
commit 04db8d4eb4
9 changed files with 55 additions and 35 deletions
+9 -6
View File
@@ -15,7 +15,7 @@ concurrency:
jobs:
auto-label:
name: Auto Label Issues
if: ${{ github.event.issue.body && contains(github.event.issue.body, '### Plugin') && contains(github.event.issue.labels.*.name, 'Bug') }}
if: ${{ github.event.issue.body && contains(github.event.issue.body, '### Plugin') && contains(github.event.issue.labels.*.name, 'bug') }}
runs-on: ubuntu-latest
permissions:
contents: read
@@ -64,13 +64,16 @@ jobs:
run: |
LABELS="$(jq --arg keys "$SELECTED_PLUGIN" '. as $data | $keys | split(", ") as $keyList | $keyList[] | . as $key | if $data[$key] != null then "\($key)[\($data[$key])]" else empty end' ./.github/scripts/keys.json | sed 's/"//g' | sed 's/^[^:]*: //')"
# Add "Plugin: " in front of each label
LABELS_WITH_PREFIX="$(echo "$LABELS" | sed 's/^/Plugin: /')"
LABELS="$(printf '%s' "$LABELS" | node -e "process.stdin.on('data', data => process.stdout.write(data.toString().toLowerCase()))")"
# Add "plugin: " in front of each label
LABELS_WITH_PREFIX="$(echo "$LABELS" | sed 's/^/plugin: /')"
FINAL_LABELS="$LABELS_WITH_PREFIX"
if [ -n "$SELECTED_LANGUAGE" ]; then
FINAL_LABELS="${FINAL_LABELS}"$'\n'"Language: $SELECTED_LANGUAGE"
LOWERCASE_LANGUAGE="$(printf '%s' "$SELECTED_LANGUAGE" | node -e "process.stdin.on('data', data => process.stdout.write(data.toString().toLowerCase()))")"
FINAL_LABELS="${FINAL_LABELS}"$'\n'"language: $LOWERCASE_LANGUAGE"
fi
# Save to GitHub environment
@@ -84,9 +87,9 @@ jobs:
REPOSITORY: ${{ github.repository }}
run: |
jq -n \
--arg severity "$SELECTED_SEVERITY" \
--arg severity "$(printf '%s' "$SELECTED_SEVERITY" | node -e "process.stdin.on('data', data => process.stdout.write(data.toString().toLowerCase()))")" \
--arg labels "$LABELS" \
'{labels: (["Severity: " + $severity] + ($labels | split("\n") | map(select(length > 0))))}' \
'{labels: (["severity: " + $severity] + ($labels | split("\n") | map(select(length > 0))))}' \
| gh api --method POST "repos/$REPOSITORY/issues/$ISSUE_NUMBER/labels" --input -
- name: Handle Missing Label
+2 -2
View File
@@ -19,11 +19,11 @@ jobs:
uses: tachiyomiorg/issue-moderator-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
duplicate-label: Duplicate
duplicate-label: duplicate
duplicate-check-enabled: true
duplicate-check-labels: |
["Plugin Request", "Domain Changed"]
["plugin request", "domain changed"]
existing-check-enabled: false
+9 -9
View File
@@ -13,7 +13,7 @@ concurrency:
jobs:
auto-label:
name: Auto Label Theme
if: contains(github.event.issue.labels.*.name, 'Plugin Request')
if: contains(github.event.issue.labels.*.name, 'plugin request')
runs-on: ubuntu-latest
permissions:
issues: write
@@ -126,20 +126,20 @@ jobs:
run: |
echo "## Theme Detection Result" >> $GITHUB_STEP_SUMMARY
if [[ "$MADARA" == "true" ]]; then
echo "🏷️ Adding label: Theme: Madara" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "Theme: Madara" -R $REPO
echo "🏷️ Adding label: theme: madara" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "theme: madara" -R $REPO
echo "theme=madara" >> "$GITHUB_OUTPUT"
elif [[ "$LIGHNOVELWP" == "true" ]]; then
echo "🏷️ Adding label: Theme: Lighnovelwp" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "Theme: Lighnovelwp" -R $REPO
echo "🏷️ Adding label: theme: lighnovelwp" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "theme: lighnovelwp" -R $REPO
echo "theme=lightnovelwp" >> "$GITHUB_OUTPUT"
elif [[ "$HOTNOVELPUB" == "true" ]]; then
echo "🏷️ Adding label: Theme: Hotnovelpub" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "Theme: Hotnovelpub" -R $REPO
echo "🏷️ Adding label: theme: hotnovelpub" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "theme: hotnovelpub" -R $REPO
echo "theme=hotnovelpub" >> "$GITHUB_OUTPUT"
elif [[ "$FICTIONEER" == "true" ]]; then
echo "🏷️ Adding label: Theme: Fictioneer" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "Theme: Fictioneer" -R $REPO
echo "🏷️ Adding label: theme: fictioneer" >> $GITHUB_STEP_SUMMARY
gh issue edit $ISSUE_NUMBER --add-label "theme: fictioneer" -R $REPO
echo "theme=fictioneer" >> "$GITHUB_OUTPUT"
else
echo "❌ No Theme Detected" >> $GITHUB_STEP_SUMMARY