@@ -14,10 +14,10 @@ jobs:
14
14
15
15
- name : Set variabler for image og cluster
16
16
run : |
17
- echo "::set-env name=TAG::$(echo ${{ github.event.client_payload.slash_command.arg1 }} | cut -c16-22)"
18
- echo "::set-env name=IMAGE::$IMAGE_BASE:${{ github.event.client_payload.slash_command.arg1 }}"
19
- echo "::set-env name=CLUSTER::${{ github.event.client_payload.slash_command.arg2 }}"
20
-
17
+ echo "::set-env name=TAG::$(echo ${{ github.event.client_payload.github.payload.issue.title }} | awk '{print $NF}' | awk -F- '{print $NF}')"
18
+ echo "::set-env name=IMAGE::$IMAGE_BASE:$(echo $ {{ github.event.client_payload.github.payload.issue.title }} | awk '{print $NF}')"
19
+ echo "::set-env name=CLUSTER::${{ github.event.client_payload.slash_command.arg1 }}"
20
+
21
21
- name : Sjekk ut kode
22
22
uses : actions/checkout@v1
23
23
with :
@@ -34,23 +34,28 @@ jobs:
34
34
35
35
- name : Oppdater kommentar med deployment status ved feil
36
36
if : failure()
37
- uses : peter-evans/create-or-update-comment@v1
37
+
38
38
with :
39
- token : ${{ secrets.NOTIFICATION }}
40
- repository : ${{ github.event.client_payload.github.payload.repository.full_name }}
41
- issue-number : ${{ github.event.client_payload.github.payload.issue.number }}
42
- body : |
43
- >promote ${{ github.event.client_payload.slash_command.args }} feilet
44
- reaction-type : -1
45
-
39
+ github-token : ${{secrets.NOTIFICATION}}
40
+ script : |
41
+ const issue = { owner: context.issue.owner,
42
+ repo: context.issue.repo,
43
+ issue_number: ${{ github.event.client_payload.github.payload.issue.number }} }
44
+ github.issues.createComment({...issue,
45
+ title: 'Deploy av ${{ env.TAG }}',
46
+ body: '>promote ${{ github.event.client_payload.slash_command.args }} feilet'})
47
+ github.issues.addLabels({...issue, labels: ['deployment-failed','${{ env.CLUSTER }}'])
48
+
46
49
- name : Oppdater kommentar med deployment status
47
50
if : success()
48
- uses : peter-evans/create-or-update-comment@v1
51
+
49
52
with :
50
- token : ${{ secrets.NOTIFICATION }}
51
- repository : ${{ github.event.client_payload.github.payload.repository.full_name }}
52
- issue-number : ${{ github.event.client_payload.github.payload.issue.number }}
53
- body : |
54
- >promote ${{ github.event.client_payload.slash_command.args }} var OK
55
- reaction-type : rocket
53
+ github-token : ${{secrets.GITHUB_TOKEN}}
54
+ script : |
55
+ const issue = { owner: context.issue.owner,
56
+ repo: context.issue.repo,
57
+ issue_number: ${{ github.event.client_payload.github.payload.issue.number }} }
58
+ const new_comment = github.issues.createComment({...issue,
59
+ body: '>promote ${{ github.event.client_payload.slash_command.args }} var OK'})
60
+ github.issues.addLabels({...issue, labels: ['${{ env.CLUSTER }}']})
56
61
0 commit comments