Avoiding skipping errors

This commit is contained in:
Julien Lengrand-Lambert
2024-09-10 15:38:06 +02:00
parent c35aa3cae6
commit 5edc6e7cf6
3 changed files with 26 additions and 68 deletions

View File

@@ -7,7 +7,7 @@ jobs:
steps:
- name: Grabbing repo stats
id: hello
uses: /jlengrand/github-repository-stats-action@main
uses: /jlengrand/github-repository-stats-action@feat/detect-failure
with:
access-token: ${{ secrets.ACCESS_TOKEN }}
server-url: ${{ secrets.SERVER_URL }}
@@ -19,7 +19,7 @@ jobs:
steps:
- name: Grabbing repo stats
id: hello_custom
uses: /jlengrand/github-repository-stats-action@main
uses: /jlengrand/github-repository-stats-action@feat/detect-failure
with:
access-token: ${{ secrets.ACCESS_TOKEN }}
server-url: ${{ secrets.SERVER_URL }}

45
dist/index.js vendored
View File

@@ -19703,55 +19703,38 @@ async function main() {
async function sendSourcesStats(serverUrl, owner, repo, time, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/sources`;
try {
const response = await got_dist_source.post(url, {
json: {
timestamp: time,
payload
},
}).json();
} catch (error) {
console.error(error);
}
const response = await got_dist_source.post(url, {
json: {
timestamp: time,
payload
},
}).json();
}
async function sendPathsStats(serverUrl, owner, repo, time, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/paths`;
try {
const response = await got_dist_source.post(url, {
json: {
timestamp: time,
payload
},
}).json();
} catch (error) {
console.error(error);
}
const response = await got_dist_source.post(url, {
json: {
timestamp: time,
payload
},
}).json();
}
async function sendViewsStats(serverUrl, owner, repo, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/views`;
try {
const response = await got_dist_source.post(url, {
json: payload,
}).json();
} catch (error) {
console.error(error);
}
}
async function sendClonesStats(serverUrl, owner, repo, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/clones`;
try {
const response = await got_dist_source.post(url, {
json: payload,
}).json();
} catch (error) {
console.error(error);
}
}
async function sendRepoStats(serverUrl, owner, repo, time, payload) {
@@ -19769,13 +19752,9 @@ async function sendRepoStats(serverUrl, owner, repo, time, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/stars`;
try {
const response = await got_dist_source.post(url, {
json: data,
}).json();
} catch (error) {
console.error(error);
}
}

View File

@@ -88,55 +88,38 @@ async function main() {
async function sendSourcesStats(serverUrl, owner, repo, time, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/sources`;
try {
const response = await got.post(url, {
json: {
timestamp: time,
payload
},
}).json();
} catch (error) {
console.error(error);
}
const response = await got.post(url, {
json: {
timestamp: time,
payload
},
}).json();
}
async function sendPathsStats(serverUrl, owner, repo, time, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/paths`;
try {
const response = await got.post(url, {
json: {
timestamp: time,
payload
},
}).json();
} catch (error) {
console.error(error);
}
const response = await got.post(url, {
json: {
timestamp: time,
payload
},
}).json();
}
async function sendViewsStats(serverUrl, owner, repo, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/views`;
try {
const response = await got.post(url, {
json: payload,
}).json();
} catch (error) {
console.error(error);
}
}
async function sendClonesStats(serverUrl, owner, repo, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/clones`;
try {
const response = await got.post(url, {
json: payload,
}).json();
} catch (error) {
console.error(error);
}
}
async function sendRepoStats(serverUrl, owner, repo, time, payload) {
@@ -154,13 +137,9 @@ async function sendRepoStats(serverUrl, owner, repo, time, payload) {
const url = `${serverUrl}/api/repositories/${owner}/${repo}/stars`;
try {
const response = await got.post(url, {
json: data,
}).json();
} catch (error) {
console.error(error);
}
}