gpb3037 [CODING CHALLENGE] Species Distribution #354
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Assign Issues to all Instructors | |
on: issue_comment | |
jobs: | |
get-members: | |
if: startsWith(github.event.comment.body, '/adminteamassign') | |
name: Get a list of group members tagged in an issue | |
runs-on: ubuntu-latest | |
steps: | |
- name: Read team slug | |
run: >- | |
echo "${{ github.event.comment.body }}" | | |
sed 's/\/adminteamassign @${{ github.repository_owner }}\/\(.*\)$/\1/' | | |
awk '{print "TEAM_SLUG="$1}' | |
>> $GITHUB_ENV | |
- name: Request team info | |
id: request-members | |
uses: actions/[email protected] | |
with: | |
github-token: ${{ secrets.EA_BOT_F24 }} | |
script: | | |
return github.rest.teams.listMembersInOrg({ | |
org: context.repo.owner, | |
team_slug: "${{env.TEAM_SLUG}}" | |
}) | |
outputs: | |
members: ${{steps.request-members.outputs.result}} | |
assign_issues: | |
needs: get-members | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
assignee: ${{fromJson(needs.get-members.outputs.members).data.*.login}} | |
steps: | |
- name: Create duplicate issue for each member | |
uses: imjohnbo/[email protected] | |
with: | |
title: ${{ matrix.assignee }} ${{ github.event.issue.title }} | |
body: ${{ github.event.issue.body }} | |
labels: ${{ join(github.event.issue.labels.*.name) }} | |
assignees: ${{ matrix.assignee }} | |
milestone: ${{ github.event.issue.milestone.number }} |