Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f35f33a

Browse files
committedFeb 29, 2024
ci: Debug ci
1 parent 118ba1a commit f35f33a

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed
 

‎.github/workflows/bump-version.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ jobs:
1515
fetch-depth: 0
1616
- name: Npm install
1717
uses: ./.github/actions
18-
- 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' --base=origin/master
19-
- run: npx nx affected -t upload-badge --parallel=3 --exclude='json-api-front,json-api-server,shared-utils,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source' --base=origin/master
18+
- name: Get git hash
19+
run: |
20+
echo "COMMIT=$(echo ${$(git log --grep="chore(release): publish" --date-order --max-count=1 --pretty=format:"%h")})"
21+
- 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' --base=${COMMIT} --head=origin/master
22+
- run: npx nx affected -t upload-badge --parallel=3 --exclude='json-api-front,json-api-server,shared-utils,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source' --base=${COMMIT} --head=origin/master
2023
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
GIST_SECRET: ${{ secrets.GIST_SECRET }}
25+
GIST_ID: ${{ secrets.GIST_ID }}
2226
# - run: npm nx affected -t e2e-ci --parallel=1
2327
# - run: npm nx affected -t deploy --no-agents
2428

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ function cleanEmptyFoldersRecursively(folder) {
1818
}
1919

2020
if (files.length === 0) {
21-
console.log("removing: ", folder);
2221
rmdirSync(folder);
2322
}
2423
}

‎tools/scripts/upload-badge.mjs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,19 @@ const filename = name
2323
const content = {"schemaVersion":1,"label":"Test Coverage","message":`${percentage}%`,"color":"green","namedLogo":"jest"}
2424
const body = JSON.stringify({ files: { [filename]: { content } } });
2525

26-
const gistUrl = new URL('397d521f54660656f2fd6195ec482581', 'https://api.github.com/gists/');
26+
const gistUrl = new URL(process.env['GIST_ID'], 'https://api.github.com/gists/');
2727
const headers = new Headers([
2828
["Content-Type", "application/json"],
2929
["Content-Length", new TextEncoder().encode(body).length],
3030
["User-Agent", "Schneegans"],
31-
["Authorization", `token ${process.env['GITHUB_TOKEN']}`],
31+
["Authorization", `token ${process.env['GIST_SECRET']}`],
3232
]);
33-
fetch(gistUrl, {
34-
method: "POST",
35-
headers,
36-
body,
37-
}).then(r => r.json()).then(r => console.log(r));
38-
3933

34+
(async function(){
35+
const result = await fetch(gistUrl, {
36+
method: "POST",
37+
headers,
38+
body,
39+
}).then(r => r.json())
40+
console.log(result);
41+
})()

0 commit comments

Comments
 (0)
Please sign in to comment.