-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (51 loc) · 1.92 KB
/
pr-merge-develop-hato-bot.yml
File metadata and controls
51 lines (51 loc) · 1.92 KB
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
47
48
49
50
51
---
name: pr-master-to-develop-hato-bot
on:
push:
branches:
- master
permissions: {}
jobs:
# masterにコミットがpushされたら、それをdevelopに反映するPRを作成するjob
# masterとdevelopの間でコミットログに差異が出ないようにする
pr-master-to-develop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: npm
node-version-file: package.json
- run: npm install -g "$(yq -r '.packageManager' package.json)"
- run: npm ci
- name: Get PullRequests
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
id: get_pull_requests
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const {tsImport} = require('tsx/esm/api')
const {script} = await tsImport(
'./scripts/get_pull_requests_hato_bot.ts',
process.env.GITHUB_WORKSPACE + '/'
)
return await script(github, context)
- name: Create PullRequest
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
if: ${{ steps.get_pull_requests.outputs.result == 0 }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const {tsImport} = require('tsx/esm/api')
const {script} = await tsImport(
'./scripts/pr_merge_develop_hato_bot/pr_master_to_develop/create_pull_request.ts',
process.env.GITHUB_WORKSPACE + '/'
)
await script(github, context)
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true