docs: translations included in wallpaper plugin work in Plasma 6.5.6 #11
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
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| checks: read | |
| statuses: read | |
| # private repos | |
| # actions: read | |
| # repository-projects: read | |
| name: i18n-extract-translations | |
| jobs: | |
| i18n-extract-translations: | |
| runs-on: ubuntu-latest | |
| env: | |
| BRANCH: action-i18n-extract-translations | |
| TITLE: "ci: extract translations" | |
| BODY: This PR was created by GitHub Actions | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Install gettext | |
| run: sudo apt-get update && sudo apt-get install -y gettext | |
| - name: Branch | |
| run: | | |
| git branch -D "${{ env.BRANCH }}" || true | |
| git checkout -b "${{ env.BRANCH }}" | |
| - name: Extract translations | |
| run: ./bin/i18n extract | |
| - name: Check if there are changes | |
| id: check_changes | |
| run: | | |
| git add . | |
| if git diff --cached -U0 | grep -v 'POT-Creation-Date' | grep -q '^[+-]'; then | |
| echo "Meaningful changes detected" | |
| echo "is_changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Only timestamp changed, ignoring" | |
| echo "is_changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit changes | |
| if: steps.check_changes.outputs.is_changed == 'true' | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "github-actions@github.com" | |
| git add . | |
| git commit -m "${{ env.TITLE }}" | |
| git push origin "${{ env.BRANCH }}" -f | |
| - name: Create Pull Request | |
| if: steps.check_changes.outputs.is_changed == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR_URL="$(gh pr list --head "${{ env.BRANCH }}" --state open --json url --jq .[].url)" | |
| if [[ -n "${PR_URL}" ]]; then | |
| echo "PR already exists -> ${PR_URL}" | |
| gh pr edit "${{ env.BRANCH }}" -t "${{ env.TITLE }}" -b "${{ env.BODY }}" | |
| else | |
| gh pr create -B main -H "${{ env.BRANCH }}" -t "${{ env.TITLE }}" -b "${{ env.BODY }}" | |
| fi |