mirror of
https://github.com/jlengrand/github-repository-stats-action.git
synced 2026-03-10 08:21:21 +00:00
Avoiding skipping errors
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -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
45
dist/index.js
vendored
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
45
index.js
45
index.js
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user