Skip to content

Commit

Permalink
Merge pull request #31856 from hashicorp/m-correct-reusable-labeler-w…
Browse files Browse the repository at this point in the history
…orkflow

Ensure `issue_comment` triggers are correctly evaluated
  • Loading branch information
justinretzolk authored Jun 8, 2023
2 parents 360f9ca + a404c1f commit f3ba90c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/reusable-add-or-remove-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ jobs:
name: 'Modify Label(s)'
runs-on: ubuntu-latest
env:
ITEM_TYPE: 'pr'
ITEM_TYPE: 'issue'
steps:
- name: 'Determine if the Item is an Issue or Pull Request'
if: github.event_name == 'issues'
# The issue_comment trigger happens for issues and pull requests.
# The best way to determine if an issue_comment trigger is related to an issue or pull request is to check
# whether or not github.event.issue.pull_request is empty.
if: github.event.pull_request || github.event.issue.pull_request
run: |
echo 'ITEM_TYPE=issue' >> $GITHUB_ENV
echo 'ITEM_TYPE=pr' >> $GITHUB_ENV
- name: 'Add Label(s) to Issue or Pull Request'
if: inputs.add != ''
Expand Down

0 comments on commit f3ba90c

Please sign in to comment.