From a6e98268d81a79ac6849bbe2bee548973a8c06b3 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 18:36:23 -0300 Subject: [PATCH 1/6] ci: restore materialized lint-typescript workflow Signed-off-by: Vitor Mattos --- .github/workflows/lint-typescript.yml | 90 +++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-typescript.yml b/.github/workflows/lint-typescript.yml index 6bab826ab3..26c881a7cc 100644 --- a/.github/workflows/lint-typescript.yml +++ b/.github/workflows/lint-typescript.yml @@ -1,5 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Type checking @@ -13,8 +18,83 @@ on: permissions: contents: read - pull-requests: read + +concurrency: + group: lint-typescript-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: - typescript: - uses: LibreCodeCoop/github-workflows/.github/workflows/lint-typescript.yml@cedd15d4962e3194f35639deda66069c469bb794 + changes: + runs-on: ubuntu-latest + 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/lint-typescript.yml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.ts' + - '**.vue' + + test: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies + env: + CYPRESS_INSTALL_BINARY: 0 + run: | + npm ci + + - name: Check types + run: | + npm run --if-present check-types + npm run --if-present ts:check + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, test] + + if: always() + + name: typescript-summary + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi From 8d45eb45221050ff4652325cfbe01c80ae424476 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 18:36:27 -0300 Subject: [PATCH 2/6] ci: restore materialized node-test workflow Signed-off-by: Vitor Mattos --- .github/workflows/node-test.yml | 102 ++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index c06e141d5e..a88c5c433f 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -1,5 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Node tests @@ -13,8 +18,95 @@ on: permissions: contents: read - pull-requests: read + +concurrency: + group: node-tests-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: - node-tests: - uses: LibreCodeCoop/github-workflows/.github/workflows/node-test.yml@cedd15d4962e3194f35639deda66069c469bb794 + changes: + runs-on: ubuntu-latest + 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/**' + - '__tests__/**' + - '__mocks__/**' + - 'src/**' + - 'appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.js' + - '**.ts' + - '**.vue' + + test: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies & build + env: + CYPRESS_INSTALL_BINARY: 0 + run: | + npm ci + npm run build --if-present + + - name: Test + run: npm run test --if-present + + - name: Test and process coverage + run: npm run test:coverage --if-present + + - name: Collect coverage + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + files: ./coverage/lcov.info + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, test] + + if: always() + + name: test-summary + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi From 4a775976572847e6ee479bac46036c8787097abd Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 18:36:30 -0300 Subject: [PATCH 3/6] ci: restore materialized sync-workflow-templates workflow Signed-off-by: Vitor Mattos --- .github/workflows/sync-workflow-templates.yml | 127 ++++++------------ 1 file changed, 39 insertions(+), 88 deletions(-) diff --git a/.github/workflows/sync-workflow-templates.yml b/.github/workflows/sync-workflow-templates.yml index 3ede4408b8..d6fbc8eb8c 100644 --- a/.github/workflows/sync-workflow-templates.yml +++ b/.github/workflows/sync-workflow-templates.yml @@ -1,17 +1,18 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/LibreCodeCoop/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT -# This workflow updates selected workflow templates from nextcloud/.github -# LibreSign-specific changes are kept in `workflow.yml.patch` files and reapplied after syncing +# This workflow will update all workflow templates # Additionally it will reapply `workflow.yml.patch` files after syncing and only then commit the result name: Update workflows on: workflow_dispatch: + schedule: + - cron: "5 2 * * 0" permissions: contents: read @@ -20,7 +21,13 @@ jobs: dispatch: runs-on: ubuntu-latest - name: Update workflows in ${{ github.event.repository.default_branch }} + strategy: + fail-fast: false + matrix: + branches: + - ${{ github.event.repository.default_branch }} + + name: Update workflows in ${{ matrix.branches }} permissions: contents: write @@ -32,112 +39,56 @@ jobs: with: require: admin + - name: Create GitHub App token + id: app-token + uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 + with: + app-id: ${{ vars.LIBRECODE_WORKFLOW_APP_ID }} + private-key: ${{ secrets.LIBRECODE_WORKFLOW_APP_PRIVATE_KEY }} + owner: LibreCodeCoop + repositories: ${{ github.event.repository.name }} + permission-contents: write + permission-pull-requests: write + permission-workflows: write + - name: Checkout workflow repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false path: source - repository: nextcloud/.github + repository: LibreCodeCoop/.github - name: Checkout app uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false path: target - ref: ${{ github.event.repository.default_branch }} - - - name: Copy selected workflow templates - run: | - echo 'SUMMARY<> $GITHUB_ENV - draft_only=0 - - workflows=( - "lint-eslint.yml" - "lint-typescript.yml" - "node-test.yml" - "npm-build.yml" - "phpunit-mariadb.yml" - "phpunit-mysql.yml" - "phpunit-pgsql.yml" - "phpunit-sqlite.yml" - ) - - for filename in "${workflows[@]}"; do - workflow="./source/workflow-templates/$filename" - echo "❓ Looking for $workflow" - if [ -f "$workflow" ]; then - target_file="./target/.github/workflows/$filename" + ref: ${{ matrix.branches }} - # Only copy if the file exists in the target repository - if [ -f "$target_file" ]; then - if [ -f "./target/.github/actions-lock.txt" ]; then - locked_version=$(grep " $filename" ./target/.github/actions-lock.txt | cat) - else - echo "# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors" >> ./target/.github/actions-lock.txt - echo "# SPDX-License""-Identifier: MIT" >> ./target/.github/actions-lock.txt - locked_version="" - fi - locked_version=$(echo $locked_version | cut -f 1 -d " ") - new_version=$(md5sum $workflow | cut -f 1 -d " ") - - # Only update if the action changes - if [[ "$locked_version" != "$new_version" ]]; then - echo "ℹ️ Locked version: $locked_version" - echo "ℹ️ Current version: $new_version" - echo "🆙 Updating existing workflow: $filename" - echo "- 🆙 Updated [$filename](https://github.com/nextcloud/.github/commits/master/workflow-templates/$filename)" >> $GITHUB_ENV - - cp "$workflow" "$target_file" - - # Apply patch if one exists - if [ -f "$target_file.patch" ]; then - echo "🩹 Applying patch" - cd ./target - set +e - patch -p1 < ".github/workflows/$filename.patch" - patch_worked=$? - set -e - cd - - if [[ "$patch_worked" == "0" ]]; then - echo " - Patch applied" >> $GITHUB_ENV - else - echo " - [ ] ❌ Patch failed" >> $GITHUB_ENV - draft_only=1 - fi - fi - - if [[ "$locked_version" != "" ]]; then - sed -i "s/$locked_version $filename/$new_version $filename/" ./target/.github/actions-lock.txt - else - echo "$new_version $filename" >> ./target/.github/actions-lock.txt - fi - else - echo "✅ Skipping $filename: already up to date" - fi - else - echo "⏭️ Skipping $filename: does not exist in target repository" - fi - fi - done - echo 'EOF' >> $GITHUB_ENV - echo "DRAFT_ONLY=${draft_only}" >> $GITHUB_ENV + - name: Synchronize workflow templates + id: sync + uses: LibreCodeCoop/github-workflows/actions/sync-workflows@57e644fe4882e942ac19bbe99729b4b7e3c9014e + with: + source: source/workflow-templates + target: target - name: Create Pull Request + if: ${{ steps.sync.outputs.changed == 'true' }} uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: - token: ${{ secrets.COMMAND_BOT_WORKFLOWS }} + token: ${{ steps.app-token.outputs.token }} commit-message: 'ci(actions): Update workflow templates from organization template repository' committer: GitHub - author: nextcloud-command + author: librecode-workflow-automation[bot] <331658022+librecode-workflow-automation[bot]@users.noreply.github.com> path: target signoff: true - branch: 'automated/noid/${{ github.event.repository.default_branch }}-update-workflows' - title: '[${{ github.event.repository.default_branch }}] ci(actions): Update workflow templates from organization template repository' - draft: ${{ env.DRAFT_ONLY == 1 }} + branch: 'automated/noid/${{ matrix.branches }}-update-workflows' + title: '[${{ matrix.branches }}] ci(actions): Update workflow templates from organization template repository' + draft: ${{ steps.sync.outputs.patch_failed == 'true' }} add-paths: .github/workflows/*.yml,.github/actions-lock.txt body: | - Automated update of all workflow templates from [nextcloud/.github](https://github.com/nextcloud/.github) - ${{ env.SUMMARY }} + Automated update of all workflow templates from [LibreCodeCoop/.github](https://github.com/LibreCodeCoop/.github) + ${{ steps.sync.outputs.summary }} labels: | dependencies 3. to review From 29809692ef44f243c486f730b04ccfd10c3d75a4 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 18:38:54 -0300 Subject: [PATCH 4/6] ci: preserve LibreSign Codecov workflow update Signed-off-by: Vitor Mattos --- .github/workflows/node-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index a88c5c433f..8f6fcf4957 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -93,7 +93,7 @@ jobs: run: npm run test:coverage --if-present - name: Collect coverage - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + uses: codecov/codecov-action@0b35c9ecc4f0529d0eb674914510c22f85b196b4 # v7.1.0 with: files: ./coverage/lcov.info From d9efd49b4c4e1b1a7940da347fdb57655b4b25bf Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 18:38:57 -0300 Subject: [PATCH 5/6] ci: preserve LibreSign node test customization Signed-off-by: Vitor Mattos --- .github/workflows/node-test.yml.patch | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/workflows/node-test.yml.patch diff --git a/.github/workflows/node-test.yml.patch b/.github/workflows/node-test.yml.patch new file mode 100644 index 0000000000..aa089d823e --- /dev/null +++ b/.github/workflows/node-test.yml.patch @@ -0,0 +1,9 @@ +diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml +--- a/.github/workflows/node-test.yml ++++ b/.github/workflows/node-test.yml +@@ -92,7 +92,7 @@ jobs: + - name: Collect coverage +- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 ++ uses: codecov/codecov-action@0b35c9ecc4f0529d0eb674914510c22f85b196b4 # v7.1.0 + with: + files: ./coverage/lcov.info From f33eb9967cda675c9badfc59a3fa79b004a53fe1 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 18:38:59 -0300 Subject: [PATCH 6/6] chore: license node test workflow patch Signed-off-by: Vitor Mattos --- .github/workflows/node-test.yml.patch.license | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/workflows/node-test.yml.patch.license diff --git a/.github/workflows/node-test.yml.patch.license b/.github/workflows/node-test.yml.patch.license new file mode 100644 index 0000000000..05d6cd0f69 --- /dev/null +++ b/.github/workflows/node-test.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreSign contributors +SPDX-License-Identifier: AGPL-3.0-or-later