Skip to content

Commit

Permalink
context-v2 label changes github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritma Gaikwad committed Jun 24, 2024
1 parent 69f7eb3 commit 431d168
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Auto Label New Issues, PRs, and Discussions
on:
issues:
types: [opened]
pull_request:
pull_request_target:
types: [opened]
discussion:
types: [created]
Expand All @@ -21,21 +21,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Add context-v2 label to new issue
id: label-issue
if: github.event_name == 'issues'
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
gh issue edit "$ISSUE_NUMBER" --add-label "context-v2"
- name: Add context-v2 label to new PR
id: label-pr
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request_target'
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
gh pr edit "$PR_NUMBER" --add-label "context-v2"
Expand All @@ -52,9 +50,8 @@ jobs:
- name: Add context-v2 label to new discussion
uses: octokit/[email protected]
id: lable-discussion
if: github.event_name == 'discussion'
env:
env:
DISCUSSION_ID: ${{ github.event.discussion.node_id }}
LABEL_ID: ${{ steps.label-data.outputs.label_id }}
with:
Expand Down

0 comments on commit 431d168

Please sign in to comment.