Skip to content

Commit

Permalink
修正できたかも (misskey-dev#13066)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikasoba authored and AyumuNekozuki committed Feb 16, 2024
1 parent d5c9ffe commit 7549dee
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/check-misskey-js-autogen.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check Misskey JS autogen

on:
pull_request:
pull_request_target:
branches:
- master
- develop
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -125,3 +131,4 @@ jobs:
comment_tag: check-misskey-js-autogen
mode: delete
message: "Thank you!"
create_if_not_exists: false

0 comments on commit 7549dee

Please sign in to comment.