-
Notifications
You must be signed in to change notification settings - Fork 5
feat: optimise generation and add validation and notifications #24
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
Merged
mpretty-cyro
merged 1 commit into
main
from
feat/optimised_generation_validation_and_failure_notifications
Jan 6, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Discord Failure Notification | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: | ||
| - "Check for Crowdin Updates" | ||
| - "Test Failure Notification" | ||
| types: | ||
| - completed | ||
|
|
||
| jobs: | ||
| notify: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event.workflow_run.conclusion == 'failure' }} | ||
| steps: | ||
| - name: Send Discord notification | ||
| env: | ||
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
| DISCORD_ROLE_ID: ${{ secrets.DISCORD_ROLE_ID }} | ||
| run: | | ||
| curl -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "content": "<@&'"$DISCORD_ROLE_ID"'> ⚠️ GitHub Action failed!", | ||
| "embeds": [{ | ||
| "title": "Workflow Failed: ${{ github.event.workflow_run.name }}", | ||
| "url": "${{ github.event.workflow_run.html_url }}", | ||
| "color": 15158332, | ||
| "fields": [ | ||
| {"name": "Repository", "value": "${{ github.repository }}", "inline": true}, | ||
| {"name": "Branch", "value": "${{ github.event.workflow_run.head_branch }}", "inline": true} | ||
| ] | ||
| }] | ||
| }' \ | ||
| "$DISCORD_WEBHOOK_URL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name: Test Failure Notification | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| fail: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Fail on purpose | ||
| run: exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| # Exclude venv folder | ||
| venv | ||
|
|
||
| .env | ||
|
|
||
| __pycache__ | ||
| .vscode/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,60 @@ | ||
| # Session Shared Scripts | ||
|
|
||
| This repo houses scripts which are shared between the different platform repos for Session, it also contains a number of Actions used to automatically sync some shared elements across the repos. | ||
|
|
||
| ## Crowdin Translation Workflow | ||
|
|
||
| Automated workflow that downloads translations from Crowdin, validates them, and creates PRs for iOS, Android, and Desktop platforms. | ||
|
|
||
| ### Required Secrets | ||
|
|
||
| | Secret | Description | | ||
| | ------------------- | ----------------------------------------- | | ||
| | `CROWDIN_API_TOKEN` | Crowdin API token with project access | | ||
| | `CROWDIN_PR_TOKEN` | GitHub token with PR creation permissions | | ||
|
|
||
| ### Workflow Inputs | ||
|
|
||
| | Input | Default | Description | | ||
| | ------------------------ | ------- | ---------------------------------------- | | ||
| | `UPDATE_PULL_REQUESTS` | `true` | Create/update PRs for all platforms | | ||
| | `SKIP_VALIDATION_ERRORS` | `false` | Continue even if string validation fails | | ||
|
|
||
| ### Schedule | ||
|
|
||
| Runs automatically every Monday at 00:00 UTC. | ||
|
|
||
| ### Validation Rules | ||
|
|
||
| #### All Strings (including plurals) | ||
|
|
||
| - **Valid `{variable}` syntax** - No broken braces (`{`, `}`, `{}`, `{ space }`) | ||
| - **Allowed HTML tags only** - Only `<b>`, `<br/>`, `<span>` | ||
| - **Valid tag syntax** - No malformed `<` (e.g., `<script>`, `<123>`) | ||
|
|
||
| #### Non-Plural Strings Only | ||
|
|
||
| - **Variables match English** - Same `{variables}` as source locale | ||
| - **Tag count matches English** - Same number of tags (warning only) | ||
|
|
||
| #### All Locales | ||
|
|
||
| - **No extra keys** - No strings that don't exist in English | ||
|
|
||
| > **Note:** Plural strings skip variable/tag comparison because languages have different plural forms (English: 2, Arabic: 6, Russian: 4). It would be nice to add suppot for plural validation in the future. | ||
|
|
||
| ## Workflow Failure Notificaiton | ||
|
|
||
| If a workflow fails and is in the list of workflows monitored by the failure notificaiton workflow, the failure notificaiton workflow will send a message to a discord webhook. | ||
|
|
||
| ### Required Secrets | ||
|
|
||
| | Secret | Description | | ||
| | --------------------- | ---------------------------------- | | ||
| | `DISCORD_WEBHOOK_URL` | Url for the Discord webhook | | ||
| | `DISCORD_ROLE_ID` | Discord role id to tag in messages | | ||
|
|
||
| ### Trigger Test Notification | ||
|
|
||
| The failure notification can be triggered by manualy running the Test Failure Notification workflow. | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.