fix: add the account name to prompt #1
Workflow file for this run
This file contains 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
name: Check i18n Changes | |
on: | |
pull_request: | |
paths: | |
- "src/i18n/locales/en/translation.json" | |
types: | |
- opened | |
- synchronize | |
jobs: | |
check-i18n-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Check for i18n changes | |
run: | | |
# Fetch the base and head branch names | |
BASE_BRANCH=$(jq -r '.base.ref' "$GITHUB_EVENT_PATH") | |
HEAD_BRANCH=$(jq -r '.head.ref' "$GITHUB_EVENT_PATH") | |
# Check if the translation.json file has been modified | |
if git diff --name-only "$BASE_BRANCH"..."$HEAD_BRANCH" | grep -q 'src/i18n/locales/en/translation.json'; then | |
echo "Translation file has been modified." | |
# Compare the JSON files and exit with a warning if necessary | |
CHANGES=$(git diff "$BASE_BRANCH"..."$HEAD_BRANCH" -- src/i18n/locales/en/translation.json | grep '^\+\s*' | grep -v '^\+\+\+' | jq -r '. | select(. != null)' || true) | |
if [ -n "$CHANGES" ]; then | |
echo "Changes detected in translation file." | |
echo "$CHANGES" | jq -r 'keys[] as $k | "\($k) has changed"' | |
exit 1 | |
fi | |
else | |
echo "Translation file has not been modified." | |
fi |