-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (40 loc) · 1.77 KB
/
auto_pr.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
38
39
40
41
42
43
44
45
46
name: "Auto PR for new sound"
on:
issue_comment:
types: [created]
jobs:
push_to_branch_and_create_pr:
name: Create a PR with the sound
if: "(contains(github.event.comment.body, ' pr ')) && ((contains(github.event.comment.author_association, 'OWNER') || contains(github.event.comment.user.login, 'librehsbot')) && (github.event.issue.number == 1))"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
name: Check out current commit
- uses: suisei-cn/actions-download-file@v1
id: downloadfile
name: Download the file
with:
url: ${{ github.event.comment.body }}
target: assets
auto-match: true
- uses: suisei-cn/actions-update-metadata@v2
id: updatemeta
name: Update sounds.yml
with:
comment: ${{ github.event.comment.body }}
target: sounds.yml
default-username: librehsbot
format: yaml
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
committer: Suisei Bot <[email protected]>
author: ${{ steps.updatemeta.outputs.username }} <${{ steps.updatemeta.outputs.username }}@users.noreply.github.com>
commit-message: "feat(sound): Add ${{ steps.downloadfile.outputs.filename }}"
title: "feat(sound): Add ${{ steps.downloadfile.outputs.filename }}"
body: |
This is an automated sound addition PR. Netlify preview should be available soon, and a preview link should be shown.
<sub>Having problems? Check your [workflow](https://github.com/suisei-cn/sbtn-assets/blob/master/.github/workflows/auto_pr.yml).</sub>
branch: sound/new
branch-suffix: "random"
labels: new-sound