40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
name: Weblate checks
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'i18n/**'
|
|
|
|
jobs:
|
|
enforce-lock:
|
|
name: Check Weblate Lock
|
|
runs-on: ubuntu-latest
|
|
if: github.head_ref != 'chore/translations'
|
|
steps:
|
|
- name: Check weblate lock
|
|
run: |
|
|
if [[ "false" = $(curl https://hosted.weblate.org/api/components/immich/immich/lock/ | jq .locked) ]]; then
|
|
exit 1
|
|
fi
|
|
- name: Find Pull Request
|
|
uses: juliangruber/find-pull-request-action@v1
|
|
id: find-pr
|
|
with:
|
|
branch: chore/translations
|
|
- name: Fail if existing weblate PR
|
|
if: ${{ steps.find-pr.outputs.number }}
|
|
run: exit 1
|
|
success-check-lock:
|
|
name: Weblate Lock Check Success
|
|
needs: [ enforce-lock ]
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
- name: Any jobs failed?
|
|
if: ${{ contains(needs.*.result, 'failure') }}
|
|
run: exit 1
|
|
- name: All jobs passed or skipped
|
|
if: ${{ !(contains(needs.*.result, 'failure')) }}
|
|
run: echo "All jobs passed or skipped" && echo "${{ toJSON(needs.*.result) }}"
|