Skip to content

Commit 1631576

Browse files
committed
neaten bump and release commands
1 parent 6b76f5d commit 1631576

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

.github/workflows/bump-command.yml

+32-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
1-
name: bump-command
2-
on:
3-
repository_dispatch:
4-
types: [bump-command]
1+
name: Bump command
2+
3+
on: issue_comment
54

65
jobs:
76
bump:
87
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+
915
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
1135
with:
1236
nix_path: nixpkgs=channel:nixos-unstable
1337

@@ -17,15 +41,14 @@ jobs:
1741
ssh-key: ${{ secrets.DEPLOY_KEY }}
1842
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name
1943
}}
20-
ref: ${{ github.event.client_payload.pull_request.head.ref }}
21-
submodules: recursive
44+
ref: ${{ steps.comment-branch.outputs.ref }}
2245

2346
- uses: expipiplus1/action-automation/bump-version@HEAD
2447
with:
2548
packageInfos: |
2649
exact-real v .
2750
packageVersions: |
28-
${{ toJson(github.event.client_payload.slash_command.args.named) }}
51+
{ "exact-real": "${{ steps.command.outputs.command-arguments }}" }
2952
3053
- run: |
31-
git push origin HEAD:${{ github.event.client_payload.pull_request.head.ref }}
54+
git push origin HEAD:"${{ steps.comment-branch.outputs.ref }}"

.github/workflows/release.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ jobs:
1010
name: Create Release
1111
runs-on: ubuntu-20.04
1212
steps:
13-
- uses: cachix/install-nix-action@v8
13+
- uses: cachix/install-nix-action@v12
14+
with:
15+
extra_nix_config: |
16+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= orion:s0C06f1M46DCpHUUP2r8iIrhfytkCbXWltMeMMa4jbw= expipiplus1/update-nix-fetchgit:Z33K0KEImsos+kVTFvZxfLxaBi+D1jEeB6cX0uCo7B0=
17+
substituters = https://cache.nixos.org/ s3://nix-cache?region=ap-southeast-1&scheme=https&endpoint=binarycache.home.monoid.al
1418
- uses: actions/checkout@v2
1519

1620
- name: Build project

.github/workflows/tag-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
update:
1010
runs-on: ubuntu-20.04
1111
steps:
12-
- uses: cachix/install-nix-action@v11
12+
- uses: cachix/install-nix-action@v12
1313
with:
1414
nix_path: nixpkgs=channel:nixos-unstable
1515
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)