diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89edc31..511c96f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 }} diff --git a/dist/index.js b/dist/index.js index a46c160..ffb16cc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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); - } } diff --git a/index.js b/index.js index c90ee01..e767adc 100644 --- a/index.js +++ b/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); - } }