python function:print report an error #2208
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: issue-automation | |
permissions: | |
issues: write | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
assignIssue: | |
name: Assign Issue to Someone | |
runs-on: ubuntu-latest | |
if: github.repository == 'microsoft/PTVS' && github.event.action == 'opened' | |
steps: | |
- name: Find last assigned | |
id: assigned | |
uses: actions/[email protected] | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
result-encoding: string | |
script: | | |
const issue = await github.rest.issues.get({ | |
issue_number: 7774, | |
owner: context.repo.owner, | |
repo: context.repo.repo | |
}); | |
return issue.data.assignees[0].login || ''; | |
- name: Dump last assigned | |
env: | |
LAST_ASSIGNED: ${{ steps.assigned.outputs.result }} | |
run: echo "$LAST_ASSIGNED" | |
- uses: lee-dohm/team-rotation@v1 | |
with: | |
last: ${{ steps.assigned.outputs.result }} | |
include: AdamYoblick bschnurr StellaHuang95 | |
id: rotation | |
- name: Dump next in rotation | |
env: | |
NEXT_ROTATION: ${{ steps.rotation.outputs.next }} | |
run: echo "$NEXT_ROTATION" | |
- name: Assign to next person | |
uses: actions/[email protected] | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.addAssignees({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
assignees: ['${{ steps.rotation.outputs.next }}'] | |
}) | |
- name: Give it the label 'needs triage' | |
uses: actions/[email protected] | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['needs triage'] | |
}) | |
- name: Save assignment to state | |
uses: actions/[email protected] | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
await github.rest.issues.removeAssignees({ | |
issue_number: 7774, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
assignees: ['${{ steps.assigned.outputs.result }}'] | |
}); | |
github.rest.issues.addAssignees({ | |
issue_number: 7774, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
assignees: ['${{ steps.rotation.outputs.next }}'] | |
}) |