mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-26 16:03:08 +02:00
修正できたかも (#13066)
This commit is contained in:
parent
2ee5507d06
commit
58ac8bc8e9
1 changed files with 18 additions and 11 deletions
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
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
@ -15,13 +15,14 @@ jobs:
|
|||
pull-requests: write
|
||||
|
||||
env:
|
||||
api_json_names: "api-base.json api-head.json"
|
||||
api_json_name: "api-head.json"
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
@ -87,22 +88,27 @@ jobs:
|
|||
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';'
|
||||
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
|
||||
run: |-
|
||||
for name in $(echo $api_json_names)
|
||||
do
|
||||
checksum=$(mktemp)
|
||||
mv $name packages/misskey-js/generator/api.json
|
||||
checksum=$(realpath ${api_json_name}_checksum)
|
||||
mv $api_json_name packages/misskey-js/generator/api.json
|
||||
|
||||
cd packages/misskey-js/generator
|
||||
pnpm run generate
|
||||
find built -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
||||
cd ../../..
|
||||
cp $checksum ${name}_checksum
|
||||
done
|
||||
cd built
|
||||
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
||||
cd ../../../..
|
||||
|
||||
- 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
|
||||
if: failure()
|
||||
|
@ -125,3 +131,4 @@ jobs:
|
|||
comment_tag: check-misskey-js-autogen
|
||||
mode: delete
|
||||
message: "Thank you!"
|
||||
create_if_not_exists: false
|
||||
|
|
Loading…
Reference in a new issue