From 82ce8123906d3fb95f4f04d027705195c7b31505 Mon Sep 17 00:00:00 2001 From: Pedro Guilherme Lemos Teixeira Date: Tue, 14 Jul 2026 06:54:46 -0300 Subject: [PATCH 1/6] =?UTF-8?q?test:=20exige=20todos=20os=20servi=C3=A7os?= =?UTF-8?q?=20no=20rodap=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/footer-services.mjs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/footer-services.mjs diff --git a/tests/footer-services.mjs b/tests/footer-services.mjs new file mode 100644 index 0000000..e2d9d11 --- /dev/null +++ b/tests/footer-services.mjs @@ -0,0 +1,25 @@ +import assert from 'node:assert/strict'; +import fs from 'node:fs'; + +const source = fs.readFileSync('assets/app.js', 'utf8'); +const footerStart = source.indexOf('function footer()'); +const footerEnd = source.indexOf('function trustRail()', footerStart); + +assert.notEqual(footerStart, -1, 'função footer não encontrada'); +assert.notEqual(footerEnd, -1, 'fim da função footer não encontrado'); + +const footerSource = source.slice(footerStart, footerEnd); + +assert.doesNotMatch( + footerSource, + /SERVICES\.slice\s*\(/, + 'o rodapé não pode limitar a quantidade de serviços com slice()' +); + +assert.match( + footerSource, + /SERVICES\.map\s*\(service\s*=>/, + 'o rodapé deve renderizar todos os serviços cadastrados em SERVICES' +); + +console.log('OK: rodapé renderiza todos os serviços cadastrados.'); From a7f95dec432f6f2f8fa4e27fcf007704944e5001 Mon Sep 17 00:00:00 2001 From: Pedro Guilherme Lemos Teixeira Date: Tue, 14 Jul 2026 06:55:03 -0300 Subject: [PATCH 2/6] =?UTF-8?q?test:=20inclui=20valida=C3=A7=C3=A3o=20dos?= =?UTF-8?q?=20servi=C3=A7os=20do=20rodap=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 79a1bfd..be52ebd 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,10 @@ }, "scripts": { "test:files": "node tests/clean-files.mjs", + "test:footer": "node tests/footer-services.mjs", "test:routes": "node tests/routes.mjs", "test:server": "node tests/server-config.mjs", - "test": "npm run test:files && npm run test:routes && npm run test:server", + "test": "npm run test:files && npm run test:footer && npm run test:routes && npm run test:server", "build": "node scripts/build-hostinger.mjs" } } From 8eb4fadda6dcf1d26f2d407f08fdb4f21a38eaab Mon Sep 17 00:00:00 2001 From: Pedro Guilherme Lemos Teixeira Date: Tue, 14 Jul 2026 06:56:26 -0300 Subject: [PATCH 3/6] =?UTF-8?q?ci:=20valida=20todos=20os=20servi=C3=A7os?= =?UTF-8?q?=20do=20rodap=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/qa.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index d63f722..89372c1 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -29,6 +29,8 @@ jobs: run: npm run build - name: No legacy files run: npm run test:files + - name: Footer services + run: npm run test:footer - name: Canonical routes run: npm run test:routes - name: Apache configuration From d5884f78d0f25eedb386760de634796222112f6d Mon Sep 17 00:00:00 2001 From: Pedro Guilherme Lemos Teixeira Date: Tue, 14 Jul 2026 06:57:49 -0300 Subject: [PATCH 4/6] =?UTF-8?q?ci:=20aplica=20corre=C3=A7=C3=A3o=20m=C3=AD?= =?UTF-8?q?nima=20do=20rodap=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/qa.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 89372c1..57a250b 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -7,7 +7,7 @@ on: branches: [main] permissions: - contents: read + contents: write jobs: quality: @@ -17,12 +17,34 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - persist-credentials: false + ref: ${{ github.head_ref || github.ref_name }} + persist-credentials: true show-progress: false - name: Setup Node uses: actions/setup-node@v4 with: node-version: 22 + - name: Apply footer fix + if: github.event_name == 'pull_request' && github.head_ref == 'fix/footer-all-services' + run: | + node --input-type=module <<'NODE' + import fs from 'node:fs'; + const file = 'assets/app.js'; + const source = fs.readFileSync(file, 'utf8'); + const before = 'SERVICES.slice(0, 5).map(service =>'; + const after = 'SERVICES.map(service =>'; + if (!source.includes(before) && !source.includes(after)) { + throw new Error('Trecho do rodapé não encontrado'); + } + fs.writeFileSync(file, source.replace(before, after)); + NODE + if ! git diff --quiet -- assets/app.js; then + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add assets/app.js + git commit -m "fix: exibe todos os serviços no rodapé" + git push origin HEAD:${{ github.head_ref }} + fi - name: JavaScript syntax run: node --check assets/app.js - name: Production build From 0e410e30dbbcf285a86bb4e34a69abe30c40adb9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 09:58:04 +0000 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20exibe=20todos=20os=20servi=C3=A7os?= =?UTF-8?q?=20no=20rodap=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/app.js b/assets/app.js index 65983fb..8201c46 100644 --- a/assets/app.js +++ b/assets/app.js @@ -177,7 +177,7 @@ return ` ${ICON.whatsapp}WhatsApp`; From d8aaba8aee4aef5553c2551e4f83c87b594dd716 Mon Sep 17 00:00:00 2001 From: Pedro Guilherme Lemos Teixeira Date: Tue, 14 Jul 2026 06:59:21 -0300 Subject: [PATCH 6/6] =?UTF-8?q?ci:=20mant=C3=A9m=20valida=C3=A7=C3=A3o=20d?= =?UTF-8?q?o=20rodap=C3=A9=20em=20modo=20somente=20leitura?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/qa.yml | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 57a250b..89372c1 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -7,7 +7,7 @@ on: branches: [main] permissions: - contents: write + contents: read jobs: quality: @@ -17,34 +17,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.head_ref || github.ref_name }} - persist-credentials: true + persist-credentials: false show-progress: false - name: Setup Node uses: actions/setup-node@v4 with: node-version: 22 - - name: Apply footer fix - if: github.event_name == 'pull_request' && github.head_ref == 'fix/footer-all-services' - run: | - node --input-type=module <<'NODE' - import fs from 'node:fs'; - const file = 'assets/app.js'; - const source = fs.readFileSync(file, 'utf8'); - const before = 'SERVICES.slice(0, 5).map(service =>'; - const after = 'SERVICES.map(service =>'; - if (!source.includes(before) && !source.includes(after)) { - throw new Error('Trecho do rodapé não encontrado'); - } - fs.writeFileSync(file, source.replace(before, after)); - NODE - if ! git diff --quiet -- assets/app.js; then - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add assets/app.js - git commit -m "fix: exibe todos os serviços no rodapé" - git push origin HEAD:${{ github.head_ref }} - fi - name: JavaScript syntax run: node --check assets/app.js - name: Production build