summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorikasoba <57828948+ikasoba@users.noreply.github.com>2024-01-23 06:35:15 +0900
committerGitHub <noreply@github.com>2024-01-23 06:35:15 +0900
commit58ac8bc8e9573337c10c013fee0be478d1ef8b74 (patch)
tree3ee08f88a07fd8aa6adf4069787b28188dbe8d36 /.github
parentfix of #13014 (misskey-js publish) (diff)
downloadsharkey-58ac8bc8e9573337c10c013fee0be478d1ef8b74.tar.gz
sharkey-58ac8bc8e9573337c10c013fee0be478d1ef8b74.tar.bz2
sharkey-58ac8bc8e9573337c10c013fee0be478d1ef8b74.zip
修正できたかも (#13066)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/check-misskey-js-autogen.yml29
1 files changed, 18 insertions, 11 deletions
diff --git a/.github/workflows/check-misskey-js-autogen.yml b/.github/workflows/check-misskey-js-autogen.yml
index 0b34cdc202..545b215756 100644
--- a/.github/workflows/check-misskey-js-autogen.yml
+++ b/.github/workflows/check-misskey-js-autogen.yml
@@ -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