Skip to content

Commit e94e039

Browse files
authored
Merge pull request #855 from dev-hato/develop
v2.3.0 おみくじリリース
2 parents 56f1082 + ddf51ae commit e94e039

28 files changed

Lines changed: 438 additions & 432 deletions

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2929
with:
3030
# We must fetch at least the immediate parents so that if this is
3131
# a pull request then we can checkout the head.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
# ここでsubmodule持ってくるとdetached headにcommitして死ぬ
1616
# submodule: 'recursive'
1717
fetch-depth: 0
1818
ref: ${{ github.event.pull_request.head.sha }}
1919
- run: echo "NODE_VERSION=16" >> "${GITHUB_ENV}"
2020
- name: Set up Node.js ${{ env.NODE_VERSION }}
21-
uses: actions/setup-node@v2.5.1
21+
uses: actions/setup-node@v3.0.0
2222
with:
2323
node-version: ${{ env.NODE_VERSION }}
2424
cache: yarn

.github/workflows/pr-copy-ci-hato-bot.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
1818
path: hato-bot
19-
- uses: actions/checkout@v2
19+
- name: Set org name
20+
uses: actions/github-script@v6
21+
id: set_org_name
22+
with:
23+
github-token: ${{secrets.GITHUB_TOKEN}}
24+
result-encoding: string
25+
script:
26+
return process.env.GITHUB_REPOSITORY.split('/')[0]
27+
- uses: actions/checkout@v3
2028
with:
2129
fetch-depth: 0
22-
repository: dev-hato/sudden-death
30+
repository: ${{steps.set_org_name.outputs.result}}/sudden-death
2331
path: sudden-death
2432
- name: Copy CI
2533
run: |
@@ -31,11 +39,7 @@ jobs:
3139
find hato-bot/${worklows_path} -type f \
3240
-not -name "*hato-bot.yml" \
3341
-exec cp {} "${DEST_PATH}" \;
34-
for f in .markdown-lint.yml .python-lint .python-lint .textlintrc
35-
do
36-
cp hato-bot/.github/linters/${f} sudden-death/.github/linters/
37-
done
38-
for f in .gitleaks.toml .pre-commit-config.yaml .python-version package.json yarn.lock
42+
for f in .markdown-lint.yml .python-lint .textlintrc .gitleaks.toml .pre-commit-config.yaml .python-version package.json yarn.lock
3943
do
4044
cp hato-bot/${f} sudden-death/
4145
done
@@ -58,7 +62,7 @@ jobs:
5862
git commit -m "鳩は唐揚げ!(hato-botのCIを反映するよ!)"
5963
echo "${{secrets.SUDDEN_DEATH_CI_PRIVATE_KEY}}" > deploy_key.pem
6064
chmod 600 deploy_key.pem
61-
REPO_URL="git@github.com:dev-hato/sudden-death.git"
65+
REPO_URL="git@github.com:${{steps.set_org_name.outputs.result}}/sudden-death.git"
6266
GITHUB_HEAD="HEAD:refs/heads/pr-copy-ci"
6367
GIT_SSH_COMMAND="ssh"
6468
GIT_SSH_COMMAND+=" -i deploy_key.pem"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
COMPOSE_DOCKER_CLI_BUILD: 1
1919
permissions:
2020
packages: write
21+
if: github.repository == github.event.pull_request.head.repo.full_name
2122
steps:
22-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2324
with:
2425
fetch-depth: 0
2526
- name: Set .env
@@ -40,11 +41,12 @@ jobs:
4041
if: ${{ github.event_name == 'pull_request' }}
4142
- run: echo 'TAG_NAME=${{ github.event.release.tag_name }}' >> "$GITHUB_ENV"
4243
if: ${{ github.event_name == 'release' }}
44+
- run: echo "REPOSITORY=${{github.repository}}" >> "${GITHUB_ENV}"
4345
- name: Build docker image
4446
run: docker-compose build --build-arg BUILDKIT_INLINE_CACHE=1
4547
- run: docker-compose push
4648
- run: |
47-
image_name="ghcr.io/dev-hato/hato-bot/hato-bot"
49+
image_name="ghcr.io/${{env.REPOSITORY}}/hato-bot"
4850
latest_tag="${image_name}:latest"
4951
docker tag "${image_name}:${TAG_NAME}" "${latest_tag}"
5052
docker push "${latest_tag}"

.github/workflows/pr-format.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
with:
1616
# ここでsubmodule持ってくるとdetached headにcommitして死ぬ
1717
# submodule: 'recursive'
1818
fetch-depth: 0
1919
ref: ${{ github.event.pull_request.head.sha }}
2020
- run: echo "PYTHON_VERSION=$(cat .python-version)" >> "${GITHUB_ENV}"
2121
- name: Set up Python ${{ env.PYTHON_VERSION }}
22-
uses: actions/setup-python@v2.3.2
22+
uses: actions/setup-python@v3
2323
with:
2424
python-version: ${{env.PYTHON_VERSION }}
2525
cache: pipenv
@@ -92,6 +92,15 @@ jobs:
9292
REPO_URL+="${{github.repository}}.git"
9393
GITHUB_HEAD="HEAD:refs/heads/fix-format-${HEAD_REF}"
9494
git push -f "${REPO_URL}" "${GITHUB_HEAD}"
95+
- name: Set org name
96+
uses: actions/github-script@v6
97+
if: env.REPO_NAME == github.repository
98+
id: set_org_name
99+
with:
100+
github-token: ${{secrets.GITHUB_TOKEN}}
101+
result-encoding: string
102+
script:
103+
return process.env.GITHUB_REPOSITORY.split('/')[0]
95104
- name: Get PullRequests
96105
uses: actions/github-script@v6
97106
env:
@@ -107,7 +116,7 @@ jobs:
107116
const pulls_list_params = {
108117
owner: context.repo.owner,
109118
repo: context.repo.repo,
110-
head: "dev-hato:fix-format-" + HEAD_REF,
119+
head: "${{steps.set_org_name.outputs.result}}:fix-format-" + HEAD_REF,
111120
base: HEAD_REF,
112121
state: "open"
113122
}
@@ -135,7 +144,7 @@ jobs:
135144
const pulls_create_params = {
136145
owner: context.repo.owner,
137146
repo: context.repo.repo,
138-
head: "dev-hato:fix-format-" + HEAD_REF,
147+
head: "${{steps.set_org_name.outputs.result}}:fix-format-" + HEAD_REF,
139148
base: HEAD_REF,
140149
title,
141150
body: "鳩の唐揚げおいしい!😋😋😋 " + number
@@ -182,7 +191,7 @@ jobs:
182191
repo: context.repo.repo
183192
}
184193
const pulls_list_params = {
185-
head: "dev-hato:" + head_name,
194+
head: "${{steps.set_org_name.outputs.result}}:" + head_name,
186195
base: HEAD_REF,
187196
state: "open",
188197
...common_params

.github/workflows/pr-merge-develop-hato-bot.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
with:
1818
fetch-depth: 0
19+
- name: Set org name
20+
uses: actions/github-script@v6
21+
id: set_org_name
22+
with:
23+
github-token: ${{secrets.GITHUB_TOKEN}}
24+
result-encoding: string
25+
script:
26+
return process.env.GITHUB_REPOSITORY.split('/')[0]
1927
- name: Get PullRequests
2028
uses: actions/github-script@v6
2129
id: get_pull_requests
@@ -25,7 +33,7 @@ jobs:
2533
const pulls_list_params = {
2634
owner: context.repo.owner,
2735
repo: context.repo.repo,
28-
head: "dev-hato:master",
36+
head: "${{steps.set_org_name.outputs.result}}:master",
2937
base: "develop",
3038
state: "open"
3139
}
@@ -44,7 +52,7 @@ jobs:
4452
repo: context.repo.repo
4553
}
4654
const pulls_create_params = {
47-
head: "dev-hato:master",
55+
head: "${{steps.set_org_name.outputs.result}}:master",
4856
base: "develop",
4957
title: "master -> develop",
5058
body: "鳩の歴史は同期される\ndevelopに新たなコミットがpushされる前にマージしてね!",

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
1818
- name: Get diff
@@ -23,6 +23,14 @@ jobs:
2323
result="${result//$'\n'/'%0A'}"
2424
result="${result//$'\r'/'%0D'}"
2525
echo "::set-output name=result::${result}"
26+
- name: Set org name
27+
uses: actions/github-script@v6
28+
id: set_org_name
29+
with:
30+
github-token: ${{secrets.GITHUB_TOKEN}}
31+
result-encoding: string
32+
script:
33+
return process.env.GITHUB_REPOSITORY.split('/')[0]
2634
- name: Get PullRequests
2735
uses: actions/github-script@v6
2836
if: ${{ steps.get_diff.outputs.result != '' }}
@@ -33,7 +41,7 @@ jobs:
3341
const pulls_list_params = {
3442
owner: context.repo.owner,
3543
repo: context.repo.repo,
36-
head: "dev-hato:develop",
44+
head: "${{steps.set_org_name.outputs.result}}:develop",
3745
base: "master",
3846
state: "open"
3947
}
@@ -53,7 +61,7 @@ jobs:
5361
repo: context.repo.repo
5462
}
5563
const pulls_create_params = {
56-
head: "dev-hato:develop",
64+
head: "${{steps.set_org_name.outputs.result}}:develop",
5765
base: "master",
5866
title: "リリース",
5967
body: "鳩は唐揚げになるため、片栗粉へ飛び込む",

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
with:
2121
submodules: "recursive"
2222
- run: echo "PYTHON_VERSION=$(cat .python-version)" >> "${GITHUB_ENV}"
2323
- name: Set up Python ${{ env.PYTHON_VERSION }}
24-
uses: actions/setup-python@v2.3.2
24+
uses: actions/setup-python@v3
2525
with:
2626
python-version: ${{ env.PYTHON_VERSION }}
2727
cache: pipenv
@@ -62,7 +62,7 @@ jobs:
6262
permissions:
6363
packages: write
6464
steps:
65-
- uses: actions/checkout@v2
65+
- uses: actions/checkout@v3
6666
with:
6767
fetch-depth: 0
6868
- name: Set .env
@@ -77,7 +77,9 @@ jobs:
7777
- name: Set up Docker Buildx
7878
id: buildx
7979
uses: docker/setup-buildx-action@v1
80-
- run: echo "TAG_NAME=latest" >> "$GITHUB_ENV"
80+
- run: |
81+
echo "TAG_NAME=latest" >> "$GITHUB_ENV"
82+
echo "REPOSITORY=${{github.repository}}" >> "${GITHUB_ENV}"
8183
- name: Build docker image
8284
run: docker-compose build --build-arg BUILDKIT_INLINE_CACHE=1
8385
- name: Start docker

.github/workflows/pr-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
with:
1818
submodules: "recursive"
1919
fetch-depth: 0
2020
- run: echo "PYTHON_VERSION=$(cat .python-version)" >> "${GITHUB_ENV}"
2121
- name: Set up Python ${{ env.PYTHON_VERSION }}
22-
uses: actions/setup-python@v2.3.2
22+
uses: actions/setup-python@v3
2323
with:
2424
python-version: ${{ env.PYTHON_VERSION }}
2525
cache: pipenv
@@ -60,7 +60,7 @@ jobs:
6060
cp -r ${{ env.venv_path }} "${DEST_PATH}"
6161
- run: echo "NODE_VERSION=16" >> "${GITHUB_ENV}"
6262
- name: Set up Node.js ${{ env.NODE_VERSION }}
63-
uses: actions/setup-node@v2.5.1
63+
uses: actions/setup-node@v3.0.0
6464
with:
6565
node-version: ${{ env.NODE_VERSION }}
6666
cache: yarn
@@ -76,6 +76,7 @@ jobs:
7676
VALIDATE_PYTHON_BLACK: false
7777
VALIDATE_JSCPD: false
7878
VALIDATE_PYTHON_ISORT: false
79+
LINTER_RULES_PATH: .
7980
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8081
WORKON_HOME: ""
8182
PYTHONPATH: ${{ env.PYTHONPATH }}

.github/workflows/pr-update-pre-commit-config-hato-bot.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
update-pre-commit-config:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
1414
ref: ${{ github.event.pull_request.head.sha }}
@@ -76,6 +76,15 @@ jobs:
7676
REPO_URL+="${{github.repository}}.git"
7777
GITHUB_HEAD="HEAD:refs/heads/fix-version-pre-commit-config-${HEAD_REF}"
7878
git push -f "${REPO_URL}" "${GITHUB_HEAD}"
79+
- name: Set org name
80+
uses: actions/github-script@v6
81+
if: env.REPO_NAME == github.repository
82+
id: set_org_name
83+
with:
84+
github-token: ${{secrets.GITHUB_TOKEN}}
85+
result-encoding: string
86+
script:
87+
return process.env.GITHUB_REPOSITORY.split('/')[0]
7988
- name: Get PullRequests
8089
uses: actions/github-script@v6
8190
env:
@@ -90,7 +99,7 @@ jobs:
9099
const pulls_list_params = {
91100
owner: context.repo.owner,
92101
repo: context.repo.repo,
93-
head: "dev-hato:fix-version-pre-commit-config-" + HEAD_REF,
102+
head: "${{steps.set_org_name.outputs.result}}:fix-version-pre-commit-config-" + HEAD_REF,
94103
base: HEAD_REF,
95104
state: "open"
96105
}
@@ -117,7 +126,7 @@ jobs:
117126
const pulls_create_params = {
118127
owner: context.repo.owner,
119128
repo: context.repo.repo,
120-
head: "dev-hato:fix-version-pre-commit-config-" + HEAD_REF,
129+
head: "${{steps.set_org_name.outputs.result}}:fix-version-pre-commit-config-" + HEAD_REF,
121130
base: HEAD_REF,
122131
title,
123132
body: "鳩の唐揚げおいしい!😋😋😋 " + number
@@ -162,7 +171,7 @@ jobs:
162171
repo: context.repo.repo
163172
}
164173
const pulls_list_params = {
165-
head: "dev-hato:" + head_name,
174+
head: "${{steps.set_org_name.outputs.result}}:" + head_name,
166175
base: HEAD_REF,
167176
state: "open",
168177
...common_params

0 commit comments

Comments
 (0)