Skip to content

Commit 4779d49

Browse files
authored
Merge pull request #945 from dev-hato/develop
v2.4.1 リリース
2 parents bf92510 + df1f777 commit 4779d49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+24332
-5464
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.env
2+
.DS_Store
3+
__pycache__/
4+
.vscode/
5+
.mypy_cache/
6+
node_modules/
7+
docker-compose.yml

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 120
3+
extend-ignore = E203

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ updates:
88
open-pull-requests-limit: 1
99
- package-ecosystem: docker
1010
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
ignore:
14+
- dependency-name: python
15+
versions:
16+
- 3.11.0b1-slim-bullseye
17+
open-pull-requests-limit: 1
18+
- package-ecosystem: docker
19+
directory: "/postgres"
1120
schedule:
1221
interval: "daily"
1322
open-pull-requests-limit: 1

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v3.0.2
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.
@@ -38,7 +38,7 @@ jobs:
3838

3939
# Initializes the CodeQL tools for scanning.
4040
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@v1
41+
uses: github/codeql-action/init@v2
4242
with:
4343
languages: ${{ matrix.language }}
4444

@@ -47,7 +47,7 @@ jobs:
4747
# If this step fails,
4848
# then you should remove it and run the build manually (see below)
4949
- name: Autobuild
50-
uses: github/codeql-action/autobuild@v1
50+
uses: github/codeql-action/autobuild@v2
5151

5252
# ℹ️ Command-line programs to run using the OS shell.
5353
# 📚 https://git.io/JvXDl
@@ -62,4 +62,4 @@ jobs:
6262
# make release
6363

6464
- name: Perform CodeQL Analysis
65-
uses: github/codeql-action/analyze@v1
65+
uses: github/codeql-action/analyze@v2

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

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: pr-check-npm
3+
4+
on:
5+
pull_request:
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
pr-update-version:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v3.0.2
19+
with:
20+
fetch-depth: 0
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
- name: Get Dependabot npm version
23+
id: get_dependabot_npm_version
24+
run: |
25+
DOCKER_CMD="npm --version"
26+
npm_version="$(docker run ghcr.io/dependabot/dependabot-core sh -c "${DOCKER_CMD}")"
27+
echo "npm version:" "${npm_version}"
28+
echo "::set-output name=npm_version::${npm_version}"
29+
- name: Update version
30+
run: |
31+
DEPENDABOT_NPM_VERSION="${{steps.get_dependabot_npm_version.outputs.npm_version}}"
32+
NPM_PATTERN_PACKAGE="s/\"npm\": \".*\"/\"npm\": \"^${DEPENDABOT_NPM_VERSION}\"/g"
33+
sed -i -e "${NPM_PATTERN_PACKAGE}" package.json
34+
- uses: actions/setup-node@v3.4.1
35+
with:
36+
cache: npm
37+
- run: |
38+
npm_version=$(jq -r '.engines.npm | ltrimstr("^")' package.json)
39+
npm install --prefer-offline --location=global "npm@${npm_version}"
40+
npm install
41+
- uses: dev-hato/actions-diff-pr-management@v0.0.8
42+
with:
43+
github-token: ${{secrets.GITHUB_TOKEN}}
44+
branch-name-prefix: fix-version
45+
pr-title-prefix: nodeをアップデートしてあげたよ!
46+
repo-name: ${{ github.event.pull_request.head.repo.full_name }}
47+
48+
# package.jsonに差分があれば、package.jsonからpackage-lock.jsonを作り出す
49+
pr-check-npm:
50+
runs-on: ubuntu-latest
51+
needs: pr-update-version
52+
53+
steps:
54+
- uses: actions/checkout@v3.0.2
55+
with:
56+
# ここでsubmodule持ってくるとdetached headにcommitして死ぬ
57+
# submodule: 'recursive'
58+
fetch-depth: 0
59+
ref: ${{ github.event.pull_request.head.sha }}
60+
- name: Set up Node.js ${{ env.NODE_VERSION }}
61+
uses: actions/setup-node@v3.4.1
62+
with:
63+
cache: npm
64+
- name: Install dependencies
65+
run: |
66+
npm_version=$(jq -r '.engines.npm | ltrimstr("^")' package.json)
67+
npm install --prefer-offline --location=global "npm@${npm_version}"
68+
npm install
69+
# 差分があったときは差分を出力する
70+
- name: Show diff
71+
id: diff
72+
run: |
73+
result=$(git diff)
74+
echo "::set-output name=result::$result"
75+
- run: |
76+
REPO_NAME="${{ github.event.pull_request.head.repo.full_name }}"
77+
echo "REPO_NAME=${REPO_NAME}" >> "${GITHUB_ENV}"
78+
- uses: dev-hato/actions-diff-pr-management@v0.0.8
79+
with:
80+
github-token: ${{secrets.GITHUB_TOKEN}}
81+
branch-name-prefix: npm
82+
pr-title-prefix: package.jsonやpackage-lock.jsonが更新されたので直してあげたよ!
83+
repo-name: ${{ github.event.pull_request.head.repo.full_name }}

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

Lines changed: 0 additions & 173 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: pr-close-hato-bot
3+
4+
on:
5+
pull_request:
6+
types:
7+
- closed
8+
9+
jobs:
10+
# PR close時にCIが出したPRをcloseする
11+
pr-close-hato-bot:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
steps:
17+
- run: |
18+
REPO_NAME="${{ github.event.pull_request.head.repo.full_name }}"
19+
echo "REPO_NAME=${REPO_NAME}" >> "${GITHUB_ENV}"
20+
- name: Close PullRequest
21+
uses: actions/github-script@v6.1.0
22+
env:
23+
HEAD_REF: ${{github.event.pull_request.head.ref}}
24+
if: env.REPO_NAME == github.repository
25+
with:
26+
github-token: ${{secrets.GITHUB_TOKEN}}
27+
script: |
28+
const HEAD_REF = process.env["HEAD_REF"]
29+
const common_params = {
30+
owner: context.repo.owner,
31+
repo: context.repo.repo
32+
}
33+
34+
for (const head_name of ["npm-" + HEAD_REF,
35+
"fix-format-" + HEAD_REF,
36+
"fix-version-pre-commit-config-" + HEAD_REF,
37+
"fix-version-python-version-" + HEAD_REF]) {
38+
let head = "${{github.event.pull_request.head.repo.owner.login}}:"
39+
head += head_name
40+
const pulls_list_params = {
41+
head,
42+
base: HEAD_REF,
43+
state: "open",
44+
...common_params
45+
}
46+
console.log("call pulls.list:", pulls_list_params)
47+
const pulls = await github.paginate(github.rest.pulls.list,
48+
pulls_list_params)
49+
50+
for (const pull of pulls) {
51+
const pulls_update_params = {
52+
pull_number: pull.number,
53+
state: "closed",
54+
...common_params
55+
}
56+
console.log("call pulls.update:", pulls_update_params)
57+
await github.rest.pulls.update(pulls_update_params)
58+
const git_deleteRef_params = {
59+
ref: "heads/" + head_name,
60+
...common_params
61+
}
62+
console.log("call git.deleteRef:", git_deleteRef_params)
63+
await github.rest.git.deleteRef(git_deleteRef_params)
64+
}
65+
}

0 commit comments

Comments
 (0)