mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Rename github workflows so they all use hyphens, instead of a mix of underscores and hyphens
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
name: Record Snapshots
|
||||
|
||||
on:
|
||||
# Triggered when a maintainer adds the "record-snapshots" label to a PR.
|
||||
pull_request: # zizmor: ignore[dangerous-triggers]
|
||||
types: [labeled]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
record-snapshots:
|
||||
name: Record Preview Snapshots
|
||||
runs-on: macos-26
|
||||
timeout-minutes: 45
|
||||
|
||||
if: >
|
||||
github.event.label.name == 'record-snapshots' &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: record-snapshots-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Remove label
|
||||
if: github.event.label.name == 'record-snapshots'
|
||||
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 #v1.3.0
|
||||
with:
|
||||
labels: record-snapshots
|
||||
|
||||
- name: Checkout PR
|
||||
uses: nschloe/action-cached-lfs-checkout@385a8ecc719e50b8c71af6ab01a624b486b7c3bc # v1.2.5
|
||||
with:
|
||||
# Check out the PR head commit (not the base branch).
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
persist-credentials: true
|
||||
|
||||
- name: Setup environment
|
||||
run: source ci_scripts/ci_common.sh && setup_github_actions_environment
|
||||
|
||||
- name: Run preview tests in recording mode
|
||||
run: swift run -q tools ci preview-tests --record
|
||||
|
||||
- name: Commit and push updated snapshots
|
||||
run: |
|
||||
git config user.name "ElementRobot"
|
||||
git config user.email "releases@riot.im"
|
||||
|
||||
# Stage only snapshot changes.
|
||||
git add PreviewTests/Sources/__Snapshots__/
|
||||
|
||||
if git diff --cached --quiet; then
|
||||
echo "✅ No snapshot changes detected."
|
||||
else
|
||||
git commit -m "Record preview snapshots"
|
||||
git push origin HEAD:refs/heads/${GITHUB_EVENT_PULL_REQUEST_HEAD_REF}
|
||||
echo "✅ Snapshots recorded and pushed."
|
||||
fi
|
||||
env:
|
||||
GITHUB_EVENT_PULL_REQUEST_HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
||||
Reference in New Issue
Block a user