Skip to content

feat(list): drag and drop reordering (#DS-4454) #769

feat(list): drag and drop reordering (#DS-4454)

feat(list): drag and drop reordering (#DS-4454) #769

# Triggered workflow by PR comment: /approve-snapshots
#
# ⚠️ This job checks out and runs PR-controlled code with a repo write token. Only comment
# /approve-snapshots after reviewing the PR's contents — the author_association check below
# only verifies the commenter, not the safety of the code being run.
name: E2E approve snapshots
on:
issue_comment:
types: [created]
# Read-only default; the write scopes this workflow needs are granted on the job itself, so a
# future job added here does not silently inherit them.
permissions:
contents: read
jobs:
approve_snapshots:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/approve-snapshots') && contains(fromJSON('["OWNER", "MEMBER"]'), github.event.comment.author_association) }}
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push changes
pull-requests: write # for thollander/actions-comment-pull-request to comment on PRs
steps:
- uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
id: comment-branch
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
with:
message: 🔄 [Updating](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) snapshots.
# Regenerated in the same container that e2e.yml compares against. Doing it on the bare
# runner instead would mean the baselines are written by one renderer and checked by another,
# and this workflow would happily commit screenshots that fail the very next run.
#
# docker compose creates a missing bind-mount source as root; packages/components already
# exists from the checkout, so only the report directories need creating up front.
- run: mkdir -p playwright-report test-results
# npm rather than yarn: no setup-node here, so the repository's Yarn 4 release is not on
# PATH. The container does its own install. e2e:docker:update-snapshots additionally mounts
# packages/components, which is how the rewritten PNGs reach the working tree for the commit
# step below.
- id: update-snapshots
run: npm run e2e:docker:update-snapshots
env:
# As in e2e.yml: the compose default is tuned for developer machines, the runner wants
# its own core count.
PLAYWRIGHT_WORKERS: 100%
- uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d # v7.2.0
id: commit-and-push
with:
commit_message: 'test: updated e2e snapshots'
file_pattern: '**/*.png'
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
if: ${{ steps.commit-and-push.outputs.changes_detected == 'true' }}
with:
message: ✅ Snapshots [updated](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/commits/${{ steps.commit-and-push.outputs.commit_hash }})!
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
if: ${{ steps.commit-and-push.outputs.changes_detected != 'true' }}
with:
message: ⚠️ No snapshot changes detected.
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
if: ${{ failure() && steps.update-snapshots.outcome == 'failure' }}
with:
message: 🚨 Failed to [update](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) snapshots.