9
9
jobs :
10
10
tag :
11
11
runs-on : ubuntu-latest
12
+ env :
13
+ tag_name : ${{ github.event.client_payload.slash_command.unnamed.arg1 }}
12
14
steps :
13
15
- name : Add run link to command comment
14
16
uses : peter-evans/create-or-update-comment@v1
15
17
with :
16
18
comment-id : ${{ github.event.client_payload.github.payload.comment.id }}
17
- body : ' [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})'
19
+ body : " [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
18
20
- uses : actions/checkout@v2
19
21
with :
20
- ref : ${{ github.event.client_payload.slash_command.ref }}
22
+ ref : ${{ github.event.client_payload.slash_command.named. ref }}
21
23
- name : Resolve version, tag and push
22
24
uses : ./
23
25
with :
24
26
script : |
25
- $args = $github.event.client_payload.slash_command.args -split ' '
26
- $force = $args -contains 'force' ? '--force' : ''
27
- $tag = $github.event.client_payload.slash_command.arg1
27
+ $args = $github.event.client_payload.slash_command.unnamed
28
+ $force = ( $args.GetEnumerator() | ? Value -eq 'force') ? '--force' : ''
29
+ $tag = $env:tag_name
28
30
if (-not $tag) {
29
31
throw "Can't create empty-named tag. Please specify tag after command: /tag vX.Y.Z"
30
32
}
@@ -41,13 +43,13 @@ jobs:
41
43
with :
42
44
comment-id : ${{ github.event.client_payload.github.payload.comment.id }}
43
45
body : |
44
- Pushed tag [`${{ github.event.client_payload.slash_command.arg1 }}`][tag]
46
+ Pushed tag [`${{ env.tag_name }}`][tag]
45
47
46
- [tag]: https://github.com/${{ github.repository }}/tree/${{ github.event.client_payload.slash_command.arg1 }}
48
+ [tag]: https://github.com/${{ github.repository }}/tree/${{ env.tag_name }}
47
49
reactions : hooray
48
50
- name : Add reaction to command comment on failure
49
51
uses : peter-evans/create-or-update-comment@v1
50
52
if : failure()
51
53
with :
52
54
comment-id : ${{ github.event.client_payload.github.payload.comment.id }}
53
- reactions : " -1"
55
+ reactions : " -1"
0 commit comments