修正できたかも (#13066)
This commit is contained in:
parent
2ee5507d06
commit
58ac8bc8e9
29
.github/workflows/check-misskey-js-autogen.yml
vendored
29
.github/workflows/check-misskey-js-autogen.yml
vendored
|
@ -1,7 +1,7 @@
|
||||||
name: Check Misskey JS autogen
|
name: Check Misskey JS autogen
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request_target:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
@ -15,13 +15,14 @@ jobs:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
api_json_names: "api-base.json api-head.json"
|
api_json_name: "api-head.json"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: setup pnpm
|
- name: setup pnpm
|
||||||
uses: pnpm/action-setup@v2
|
uses: pnpm/action-setup@v2
|
||||||
|
@ -87,22 +88,27 @@ jobs:
|
||||||
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';'
|
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';'
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
|
- name: get head checksum
|
||||||
|
run: |-
|
||||||
|
checksum=$(realpath head_checksum)
|
||||||
|
|
||||||
|
cd packages/misskey-js/src
|
||||||
|
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
||||||
|
cd ../../..
|
||||||
|
|
||||||
- name: build autogen
|
- name: build autogen
|
||||||
run: |-
|
run: |-
|
||||||
for name in $(echo $api_json_names)
|
checksum=$(realpath ${api_json_name}_checksum)
|
||||||
do
|
mv $api_json_name packages/misskey-js/generator/api.json
|
||||||
checksum=$(mktemp)
|
|
||||||
mv $name packages/misskey-js/generator/api.json
|
|
||||||
|
|
||||||
cd packages/misskey-js/generator
|
cd packages/misskey-js/generator
|
||||||
pnpm run generate
|
pnpm run generate
|
||||||
find built -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
cd built
|
||||||
cd ../../..
|
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
||||||
cp $checksum ${name}_checksum
|
cd ../../../..
|
||||||
done
|
|
||||||
|
|
||||||
- name: check update for type definitions
|
- name: check update for type definitions
|
||||||
run: diff $(echo -n ${api_json_names} | awk -v RS=" " '{ printf "%s_checksum ", $0 }')
|
run: diff head_checksum ${api_json_name}_checksum
|
||||||
|
|
||||||
- name: send message
|
- name: send message
|
||||||
if: failure()
|
if: failure()
|
||||||
|
@ -125,3 +131,4 @@ jobs:
|
||||||
comment_tag: check-misskey-js-autogen
|
comment_tag: check-misskey-js-autogen
|
||||||
mode: delete
|
mode: delete
|
||||||
message: "Thank you!"
|
message: "Thank you!"
|
||||||
|
create_if_not_exists: false
|
||||||
|
|
Loading…
Reference in a new issue