Skip to content

Commit d855470

Browse files
authored
Merge pull request #490 from dev-hato/develop
リリース
2 parents 3f2e56c + dae6eb9 commit d855470

26 files changed

Lines changed: 1290 additions & 2221 deletions

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "monthly"
7+
open-pull-requests-limit: 1
78
- package-ecosystem: docker
89
directory: "/"
910
schedule:
1011
interval: "monthly"
12+
open-pull-requests-limit: 1
1113
- package-ecosystem: docker
1214
directory: "/setup/pgsql"
1315
schedule:
1416
interval: "monthly"
17+
open-pull-requests-limit: 1
1518
- package-ecosystem: github-actions
1619
directory: "/"
1720
schedule:
1821
interval: "monthly"
22+
open-pull-requests-limit: 1
1923
- package-ecosystem: npm
2024
directory: "/"
2125
schedule:
2226
interval: "monthly"
27+
open-pull-requests-limit: 1

.github/linters/.hadolint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignored:
2+
- DL3018

.github/workflows/pr-check-pipfile.yml

Lines changed: 0 additions & 143 deletions
This file was deleted.

.github/workflows/pr-check-yarn.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node-version: [12.x]
16+
node-version: [14.x]
1717
fail-fast: false
1818

1919
steps:
@@ -22,8 +22,9 @@ jobs:
2222
# ここでsubmodule持ってくるとdetached headにcommitして死ぬ
2323
# submodule: 'recursive'
2424
fetch-depth: 0
25+
ref: ${{ github.event.pull_request.head.sha }}
2526
- name: Set up Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v2.1.2
27+
uses: actions/setup-node@v2.1.5
2728
with:
2829
node-version: ${{ matrix.node-version }}
2930
- name: Install dependencies
@@ -46,7 +47,7 @@ jobs:
4647
git push -f https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:refs/heads/yarn-${{github.event.pull_request.head.ref}}
4748
# pushしたブランチでPRを作る
4849
- name: Create PullRequest
49-
uses: actions/github-script@v3
50+
uses: actions/github-script@v4.0.2
5051
if: github.event.pull_request.head.repo.full_name == github.repository && steps.diff.outputs.result != ''
5152
with:
5253
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -76,20 +77,22 @@ jobs:
7677
console.log("call pulls.create:")
7778
console.log(pulls_create_params)
7879
github.pulls.create(pulls_create_params).then(create_res => {
79-
const issues_add_assignees_params = {
80-
issue_number: create_res.data.number,
81-
assignees: ["${{github.event.pull_request.user.login}}"],
82-
...common_params
80+
if("${{github.event.pull_request.user.login}}" !== "dependabot[bot]") {
81+
const issues_add_assignees_params = {
82+
issue_number: create_res.data.number,
83+
assignees: ["${{github.event.pull_request.user.login}}"],
84+
...common_params
85+
}
86+
console.log("call issues.addAssignees:")
87+
console.log(issues_add_assignees_params)
88+
github.issues.addAssignees(issues_add_assignees_params)
8389
}
84-
console.log("call issues.addAssignees:")
85-
console.log(issues_add_assignees_params)
86-
github.issues.addAssignees(issues_add_assignees_params)
8790
})
8891
}
8992
})
9093
# 既にpackage.json, yarn.lock修正のPRがある状態で、手動でpackage.json, yarn.lockを修正した場合、修正のPRを閉じる
9194
- name: Close PullRequest
92-
uses: actions/github-script@v3
95+
uses: actions/github-script@v4.0.2
9396
if: github.event.pull_request.head.repo.full_name == github.repository && steps.diff.outputs.result == ''
9497
with:
9598
github-token: ${{secrets.GITHUB_TOKEN}}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: pr-master-to-develop-hato-bot
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
# masterにコミットがpushされたら、それをdevelopに反映するPRを作成するjob
10+
# masterとdevelopの間でコミットログに差異が出ないようにする
11+
pr-master-to-develop:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: [3.9]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
- name: Create PullRequest
22+
uses: actions/github-script@v4.0.2
23+
with:
24+
github-token: ${{secrets.GITHUB_TOKEN}}
25+
script: |
26+
const common_params = {
27+
owner: context.repo.owner,
28+
repo: context.repo.repo
29+
}
30+
const pull_params = {
31+
head: "dev-hato:master",
32+
base: "develop",
33+
...common_params
34+
}
35+
const pulls_list_params = {
36+
state: "open",
37+
...pull_params
38+
}
39+
console.log("call pulls.list:")
40+
console.log(pulls_list_params)
41+
github.pulls.list(pulls_list_params).then(list_res => {
42+
if (list_res.data.length === 0) {
43+
const pulls_create_params = {
44+
title: "master -> develop",
45+
body: "鳩の歴史は同期される\ndevelopに新たなコミットがpushされる前にマージしてね!",
46+
...pull_params
47+
}
48+
console.log("call pulls.create:")
49+
console.log(pulls_create_params)
50+
github.pulls.create(pulls_create_params).then(create_res => {
51+
const release_users = ["nakkaa"]
52+
const pulls_request_reviews_params = {
53+
pull_number: create_res.data.number,
54+
reviewers: release_users,
55+
...common_params
56+
}
57+
console.log("call pulls.requestReviewers:")
58+
console.log(pulls_request_reviews_params)
59+
github.pulls.requestReviewers(pulls_request_reviews_params)
60+
const issues_add_assignees_params = {
61+
issue_number: create_res.data.number,
62+
assignees: release_users,
63+
...common_params
64+
}
65+
console.log("call issues.addAssignees:")
66+
console.log(issues_add_assignees_params)
67+
github.issues.addAssignees(issues_add_assignees_params)
68+
})
69+
}
70+
})

.github/workflows/pr-release-hato-bot.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: [3.8]
14+
python-version: [3.9]
1515

1616
steps:
1717
- uses: actions/checkout@v2
@@ -26,7 +26,7 @@ jobs:
2626
result="${result//$'\r'/'%0D'}"
2727
echo "::set-output name=result::${result}"
2828
- name: Create PullRequest
29-
uses: actions/github-script@v3
29+
uses: actions/github-script@v4.0.2
3030
if: steps.get_diff.outputs.result != ''
3131
with:
3232
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -58,22 +58,24 @@ jobs:
5858
console.log(pulls_create_params)
5959
github.pulls.create(pulls_create_params).then(create_res => {
6060
const release_users = ["nakkaa"]
61-
const pulls_create_review_request_params = {
61+
const pulls_request_reviews_params = {
6262
pull_number: create_res.data.number,
6363
reviewers: release_users,
6464
...common_params
6565
}
66-
console.log("call pulls.createReviewRequest:")
67-
console.log(pulls_create_review_request_params)
68-
github.pulls.createReviewRequest(pulls_create_review_request_params)
69-
const issues_add_assignees_params = {
70-
issue_number: create_res.data.number,
71-
assignees: release_users,
72-
...common_params
66+
console.log("call pulls.requestReviewers:")
67+
console.log(pulls_request_reviews_params)
68+
github.pulls.requestReviewers(pulls_request_reviews_params)
69+
if("${{github.event.pull_request.user.login}}" !== "dependabot[bot]") {
70+
const issues_add_assignees_params = {
71+
issue_number: create_res.data.number,
72+
assignees: release_users,
73+
...common_params
74+
}
75+
console.log("call issues.addAssignees:")
76+
console.log(issues_add_assignees_params)
77+
github.issues.addAssignees(issues_add_assignees_params)
7378
}
74-
console.log("call issues.addAssignees:")
75-
console.log(issues_add_assignees_params)
76-
github.issues.addAssignees(issues_add_assignees_params)
7779
})
7880
}
7981
})

0 commit comments

Comments
 (0)