Skip to content

Commit 2c445a7

Browse files
committed
ci: Debug ci
1 parent b5bea75 commit 2c445a7

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

.github/actions/action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ description: 'Checks out the repository and install'
33
runs:
44
using: 'composite'
55
steps:
6-
# - uses: actions/checkout@v4
7-
# with:
8-
# fetch-depth: 0
96
- name: Setup Node.js
107
uses: actions/setup-node@v4
118
with:

.github/workflows/bump-version.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
run: |
2020
COMMIT=$(git show-ref --tags --hash | tail -n 1)
2121
echo "NX_BASE=$(echo ${COMMIT})" >> $GITHUB_ENV
22-
- run: git show-ref --tags --hash | tail -n 1
2322
- name: Test and build
2423
run: npx nx affected -t test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source'
2524
- name: Upload test coverage badge

tools/scripts/preparation-hybrid-npm-package.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFileSync, writeFileSync, renameSync, unlinkSync } from 'fs';
1+
import { readFileSync, writeFileSync, unlinkSync } from 'fs';
22
import {sep, join} from 'path'
33

44
import devkit from '@nx/devkit';
@@ -78,3 +78,4 @@ unlinkSync(join('mjs', 'package.json'))
7878
unlinkSync(join('cjs', 'package.json'))
7979
unlinkSync(join('mjs', 'README.md'))
8080
unlinkSync(join('cjs', 'README.md'))
81+

tools/scripts/upload-badge.mjs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { readFileSync, writeFileSync, renameSync, unlinkSync } from 'fs';
2-
import { sep, join } from 'path';
1+
import { readFileSync } from 'fs';
2+
import { join } from 'path';
33

44
import devkit from '@nx/devkit';
55

@@ -23,7 +23,8 @@ const filename = `${name}.json`
2323
const content = JSON.stringify({"schemaVersion":1,"label":"Test Coverage","message":`${percentage}%`,"color":"green","namedLogo":"jest"})
2424
const body = JSON.stringify({ files: { [filename]: { content } } });
2525

26-
// process.env['GIST_SECRET'] = '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'
26+
// process.env['GIST_SECRET'] = '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'
27+
// process.env['GIST_SECRET'] = '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213123123'
2728
// process.env['GIST_ID'] = '397d521f54660656f2fd6195ec482581'
2829
const gistUrl = new URL(process.env['GIST_ID'], 'https://api.github.com/gists/');
2930
const headers = new Headers([
@@ -34,9 +35,16 @@ const headers = new Headers([
3435
]);
3536

3637

38+
(async function(){
39+
const status = await fetch(gistUrl, {
40+
method: "PATCH",
41+
headers,
42+
body,
43+
}).then(r => r.status)
44+
if (status === 200) {
45+
console.log('Badge has been updated')
46+
} else {
47+
console.warn('Badge has not been updated')
48+
}
49+
})();
3750

38-
const result = await fetch(gistUrl, {
39-
method: "PATCH",
40-
headers,
41-
body,
42-
}).then(r => r.json()).then(r => console.log(r))

0 commit comments

Comments
 (0)