Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(www): remove "missing translations" action #1928

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,47 +82,3 @@ jobs:
run: |
echo "This PR has the 'need test' label. Please remove it before merging."
exit 1

translations:
name: '[WIP] Missing Translations Label'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- name: Check resources/original_messages.json
id: changed-original-messages
uses: tj-actions/changed-files@v35
with:
files: resources/original_messages.json

- name: Collect src/www/messages Changes
if: steps.changed-original-messages.outputs.any_changed == 'true'
id: changed-translated-messages
uses: tj-actions/changed-files@v35
with:
files: src/www/messages/*.json

- name: Check src/www/messages Changes
if: steps.changed-original-messages.outputs.any_changed == 'true'
id: not-every-translation-changed
run: |
TRANSLATIONS_COUNT="$(ls src/www/messages | wc -l | xargs)"
IFS=' ' read -r -a TRANSLATED_MESSAGES <<< "${{ steps.changed-translated-messages.outputs.all_changed_files }}"
TRANSLATED_MESSAGES_COUNT="${#TRANSLATED_MESSAGES[@]}"
if [ "${TRANSLATED_MESSAGES_COUNT}" != "${TRANSLATIONS_COUNT}" ]; then
echo "Translations are not atomic. Please update all translations in a single commit."
echo "Changed translations: ${TRANSLATED_MESSAGES_COUNT}"
echo "Expected translations: ${TRANSLATIONS_COUNT}"
echo "result=true" >> "${GITHUB_OUTPUT}"
fi

- name: Apply 'Missing Translations' Label
if: steps.not-every-translation-changed.outputs.result == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: missing translations
Loading