Skip to content

Commit

Permalink
remove npmrc change and commit only the pot file
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Jan 12, 2024
1 parent 3de89d1 commit 4b79165
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/wp-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,31 @@ jobs:
- name: Build JavaScript
run: npm run build

- name: Remove token
run: git checkout -- '.npmrc'

- name: Get current timestamp for .pot header
id: date
run: echo "TIMESTAMP=date('%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT

- name: Add text domains
run: npx node-wp-i18n addtextdomain

- name: Generate POT file
run: vendor/bin/wp i18n make-pot . ./languages/${{ github.event.repository.name }}.pot --headers='{"Report-Msgid-Bugs-To":"https://github.com/${{ github.repository }}/issues","POT-Creation-Date":${{ steps.date.outputs.TIMESTAMP }}+00:00' --exclude=assets,tests,src
run: vendor/bin/wp i18n make-pot . ./languages/${{ github.event.repository.name }}.pot --headers='{"Report-Msgid-Bugs-To":"https://github.com/${{ github.repository }}/issues" --exclude=assets,tests,src

- name: Check if there are file changes
id: changes
continue-on-error: true
run: git diff --exit-code

- name: Commit web files
- name: Commit updated .pot file
if: steps.changes.outcome == 'failure'
run: |
git config --local user.name "${{ github.event.head_commit.author.name }}"
git config --local user.email "${{ github.event.head_commit.author.email }}"
git remote -v
git add -A
git add '*.pot'
git commit -m "WordPress I18N triggered by commit ${{ github.sha }}"
git status
Expand Down

0 comments on commit 4b79165

Please sign in to comment.