Skip to content
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

Label developer community issues when created #56667

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/devcomm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Add Developer Community label
on:
issues:
types: [opened]
jobs:
add_labels:
runs-on: ubuntu-latest
if: ${{ github.repository == 'dotnet/roslyn' && github.event.issue.user.login == 'vsfeedback' }}
steps:
- name: Get label data
env:
ORGANIZATION: dotnet
REPOSITORY: roslyn
LABEL_NAME: Developer Community
run: |
gh api graphql -f query='
query($org: String!, $repo:String!, $label:String!) {
repository(name: $repo, owner: $org) {
label(name:$label) {
id
}
}
}' -f org=$ORGANIZATION -f repo=$REPOSITORY -f label="$LABEL_NAME" > label_data.json

echo 'LABEL_ID='$(jq '.data.repository.label.id' label_data.json) >> $GITHUB_ENV

- name: Add Developer Community label
env:
ISSUE_ID: ${{ github.event.issue.node_id }}
run: |
gh api graphql -f query='
mutation($issue:ID!, $label:[ID!]!) {
addLabelsToLabelable(input: {labelIds:$label, labelableId:$issue}) {
clientMutationId
}
}' -f issue=$ISSUE_ID -f label=LABEL_ID