forked from SonarSource/sonar-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.17 KB
/
StartProgress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Start Progress
on:
project_card:
types: ["moved"]
jobs:
assign_to_self:
runs-on: ubuntu-latest
if: |
github.event.changes.column_id.from == 4971951
&& github.event.project_card.column_id == 4971952
&& github.event.project_card.content_url != null
steps:
# https://github.com/actions/github-script
- uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
//
async function addAssignee(issue, login) {
console.log("Assigning to: " + login);
await github.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
assignees: [login]
});
}
//
const url = context.payload.project_card.content_url;
console.log("Processing " + url);
var issue = (await github.request(url)).data;
if(!issue.assignee){
addAssignee(issue, context.payload.sender.login);
}
console.log(`Done`);