Skip to content

Commit

Permalink
Update auto-label-issues.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Durgesh4993 authored May 25, 2024
1 parent 2a28f0d commit 5ec20d5
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/auto-label-issues.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
name: Auto Label GSSoC Issues
name: Auto-label on Bug Report

on:
issues:
types: [opened]

jobs:
labeler:
auto-label:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check if issue is a Bug Report
run: |
IS_BUG_REPORT=$(jq -r '.issue.body | contains("bug-description")' $GITHUB_EVENT_PATH)
if [ "$IS_BUG_REPORT" = true ]; then
echo "::set-output name=is_bug_report::true"
else
echo "::set-output name=is_bug_report::false"
fi
- name: Add GSSoC Label
uses: actions/github-script@v3
- name: Add labels if issue is a Bug Report
if: ${{ steps.auto-label.outputs.is_bug_report == 'true' }}
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.addLabels({
const labelsToAdd = ["GSSoC", "Bug"];
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['gssoc']
labels: labelsToAdd
});

0 comments on commit 5ec20d5

Please sign in to comment.