Prepare for 2024.1: convert kotlin's Sequence to java's Iterable #125
Workflow file for this run
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: Auto Add Labels and Assignees | |
on: | |
pull_request_target: | |
types: ["opened", "reopened", "ready_for_review"] | |
jobs: | |
add_label: | |
permissions: | |
contents: read | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/labeler@v4 | |
if: ${{ github.event.pull_request.draft == false }} | |
add_assignee: | |
runs-on: ubuntu-latest | |
needs: add_label | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set Assignees | |
uses: actions/github-script@v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
let issue_number = context.payload.pull_request.number; | |
let issueDetails = await github.issues.get({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number, | |
}); | |
let labels = issueDetails.data.labels | |
const assignees = []; | |
const labelsToAssignees = { | |
'product: CLion': ['tpasternak'], | |
'product: IntelliJ': ['mai93'], | |
'product: GoLand': ['blorente'], | |
'product: Android Studio': ['mai93'] | |
}; | |
for (const label of labels) { | |
if (label.name in labelsToAssignees) { | |
assignees.push(...labelsToAssignees[label.name]); | |
} | |
} | |
if (assignees.length > 0) { | |
await github.issues.addAssignees({ | |
issue_number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
assignees | |
}); | |
} |