Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions workflow-templates/lint-translations.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Linting translation source strings",
"description": "Checks the source strings a pull request adds against the translation guidelines of the developer manual",
"iconName": "octicon globe",
"categories": [
"JavaScript",
"PHP",
"TypeScript",
"Vue"
],
"filePatterns": [
"^\\.tx/config$"
]
}
90 changes: 90 additions & 0 deletions workflow-templates/lint-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Lint translations

on: pull_request

permissions:
contents: read

concurrency:
group: lint-translations-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest-low
permissions:
contents: read
pull-requests: read

outputs:
src: ${{ steps.changes.outputs.src }}

steps:
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- '**/.l10nignore'
- '**/appinfo/info.xml'
- '**.html'
- '**.js'
- '**.jsx'
- '**.mjs'
- '**.php'
- '**.py'
- '**.ts'
- '**.tsx'
- '**.vue'

source-strings:
runs-on: ubuntu-latest

needs: changes
if: needs.changes.outputs.src != 'false'

container: ghcr.io/nextcloud/continuous-integration-translations:latest # zizmor: ignore[unpinned-images]

name: Source strings

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
path: head

- name: Checkout base branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.base.sha }}
path: base

- name: Lint the source strings added by this pull request
working-directory: head
run: /translationtool.phar lint-source-strings --base=../base --format=github

summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [changes, source-strings]

if: always()

name: lint-translations

steps:
- name: Summary status
run: if ${{ needs.changes.outputs.src != 'false' && needs.source-strings.result != 'success' }}; then exit 1; fi