summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorzyoshoka <107108195+zyoshoka@users.noreply.github.com>2025-04-28 12:57:47 +0900
committerGitHub <noreply@github.com>2025-04-28 12:57:47 +0900
commit7041a3de2a4880b4aa8fbab84de5e1a63b86eaca (patch)
tree55d3e263af84bf740343c80eff698eaa2b7d7c41 /.github
parentperf(frontend): improve timeline performance (diff)
downloadsharkey-7041a3de2a4880b4aa8fbab84de5e1a63b86eaca.tar.gz
sharkey-7041a3de2a4880b4aa8fbab84de5e1a63b86eaca.tar.bz2
sharkey-7041a3de2a4880b4aa8fbab84de5e1a63b86eaca.zip
chore: fix Chromatic CI diff strategy (#15902)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/storybook.yml18
1 files changed, 5 insertions, 13 deletions
diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml
index 037e6dd7f1..57d1518d9d 100644
--- a/.github/workflows/storybook.yml
+++ b/.github/workflows/storybook.yml
@@ -35,10 +35,7 @@ jobs:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Checkout actual HEAD
if: github.event_name == 'pull_request_target'
- id: rev
- run: |
- echo "base=$(git rev-list --parents -n1 HEAD | cut -d" " -f2)" >> $GITHUB_OUTPUT
- git checkout $(git rev-list --parents -n1 HEAD | cut -d" " -f3)
+ run: git checkout "$(git rev-list --parents -n1 HEAD | cut -d" " -f3)"
- name: Setup pnpm
uses: pnpm/action-setup@v4.1.0
- name: Use Node.js 20.x
@@ -81,21 +78,16 @@ jobs:
if: github.event_name == 'pull_request_target'
id: chromatic_pull_request
run: |
- DIFF="${{ steps.rev.outputs.base }} HEAD"
- if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then
- DIFF="HEAD"
- fi
- CHROMATIC_PARAMETER="$(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r $(echo "$DIFF") | xargs))"
+ CHROMATIC_PARAMETER="$(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r origin/${GITHUB_BASE_REF}...origin/${GITHUB_HEAD_REF} | xargs))"
if [ "$CHROMATIC_PARAMETER" = " --skip" ]; then
echo "skip=true" >> $GITHUB_OUTPUT
fi
- BRANCH="${{ github.event.pull_request.head.user.login }}:$HEAD_REF"
- if [ "$BRANCH" = "misskey-dev:$HEAD_REF" ]; then
- BRANCH="$HEAD_REF"
+ BRANCH="${{ github.event.pull_request.head.user.login }}:$GITHUB_HEAD_REF"
+ if [ "$BRANCH" = "misskey-dev:$GITHUB_HEAD_REF" ]; then
+ BRANCH="$GITHUB_HEAD_REF"
fi
pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static --branch-name "$BRANCH" $(echo "$CHROMATIC_PARAMETER")
env:
- HEAD_REF: ${{ github.event.pull_request.head.ref }}
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Notify that Chromatic detects changes
uses: actions/github-script@v7.0.1