1
- name : bump-command
2
- on :
3
- repository_dispatch :
4
- types : [bump-command]
1
+ name : Bump command
2
+
3
+ on : issue_comment
5
4
6
5
jobs :
7
6
bump :
8
7
runs-on : ubuntu-20.04
8
+
9
+ # Only run if we're invoked with a new command comment on a pull request.
10
+ if : |
11
+ github.event_name == 'issue_comment' && github.event.action == 'created'
12
+ && github.event.issue.pull_request != null
13
+ && startsWith(github.event.comment.body, '/bump')
14
+
9
15
steps :
10
- - uses : cachix/install-nix-action@v11
16
+ - name : Check for Command
17
+ id : command
18
+ uses : xt0rted/slash-command-action@v1
19
+ continue-on-error : true
20
+ with :
21
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
22
+ command : bump
23
+ reaction : ' true'
24
+ reaction-type : eyes
25
+ allow-edits : ' true'
26
+ permission-level : write
27
+
28
+ - name : Get PR Branch
29
+ id : comment-branch
30
+ uses : xt0rted/pull-request-comment-branch@v1
31
+ with :
32
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
33
+
34
+ - uses : cachix/install-nix-action@v12
11
35
with :
12
36
nix_path : nixpkgs=channel:nixos-unstable
13
37
@@ -17,15 +41,14 @@ jobs:
17
41
ssh-key : ${{ secrets.DEPLOY_KEY }}
18
42
repository : ${{ github.event.client_payload.pull_request.head.repo.full_name
19
43
}}
20
- ref : ${{ github.event.client_payload.pull_request.head.ref }}
21
- submodules : recursive
44
+ ref : ${{ steps.comment-branch.outputs.ref }}
22
45
23
46
- uses : expipiplus1/action-automation/bump-version@HEAD
24
47
with :
25
48
packageInfos : |
26
49
exact-real v .
27
50
packageVersions : |
28
- ${{ toJson(github.event.client_payload.slash_command.args.named) } }
51
+ { "exact-real": " ${{ steps.command.outputs.command-arguments }}" }
29
52
30
53
- run : |
31
- git push origin HEAD:${{ github.event.client_payload.pull_request.head. ref }}
54
+ git push origin HEAD:" ${{ steps.comment-branch.outputs. ref }}"
0 commit comments