Skip to content

Commit

Permalink
feat: improve translation check (#495)
Browse files Browse the repository at this point in the history
**Summary**
This makes a few change to how we check for translations:
 - It splits this into a distinct workflow that is ran on a push to `main` (instead of checking for every pull request action)
 - It also adds a `workflow_dispatch` trigger such that we can manually run this check with any branch
 - It updates the output to only list the files that need to be updated for translations. See the two examples below

Example with no translations needed:
![Screenshot 2023-09-07 at 9 08 29 AM](https://github.com/sassoftware/vscode-sas-extension/assets/1058265/16041ef5-39d3-44a6-a059-0ab09abe8fac)

Example with translations needed: 
![Screenshot 2023-09-07 at 9 08 09 AM](https://github.com/sassoftware/vscode-sas-extension/assets/1058265/66b139fc-bcea-47e5-a370-be0d3599ea7d)

**Testing**
 - [x] Made sure github actions passed
 - [x] Temporarily added this branch to the translation check
 - [ ] Will test `workflow_dispatch` on main (workflow_dispatch triggers have to be in the default branch before they can be triggered via actions)
  • Loading branch information
scottdover authored Sep 8, 2023
1 parent 96116bd commit 5caa488
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,3 @@ jobs:
- run: xvfb-run -a npm run test
if: runner.os == 'Linux'
- run: npx @vscode/vsce package
check-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "npm"
- run: npm ci
- run: npm run locale --update-locales
- run: git diff --exit-code
29 changes: 29 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Translation Check

on:
workflow_dispatch:
push:
branches:
- main

jobs:
check-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "npm"
- run: npm ci
- run: npm run locale --update-locales
- run: |
CHANGES=$(git diff --name-only)
if [ -z "$CHANGES" ]
then
echo "No translations needed"
else
echo "The following files need translations:"
echo $CHANGES
exit 1
fi

0 comments on commit 5caa488

Please sign in to comment.