Skip to content

Commit

Permalink
new way of printing output
Browse files Browse the repository at this point in the history
  • Loading branch information
DerLev committed Apr 1, 2024
1 parent c463543 commit beef513
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/integration-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,11 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const response = await fetch("https://run.googleapis.com/v2/projects/${{ vars.GCP_PROJECT_ID }}/locations/${{ env.API_CLOUD_RUN_LOCATION }}/services/${{ env.API_CLOUD_RUN_SERVICE }}/revisions", { headers: { 'Authorization': "Bearer ${{ steps.auth.outputs.access_token }}" } })
.catch(err => {
console.error(err);
throw new Error(err);
}).then(res => res.json());
const rawResponse = await fetch("https://run.googleapis.com/v2/projects/${{ vars.GCP_PROJECT_ID }}/locations/${{ env.API_CLOUD_RUN_LOCATION }}/services/${{ env.API_CLOUD_RUN_SERVICE }}/revisions", { headers: { 'Authorization': "Bearer ${{ steps.auth.outputs.access_token }}" } });
console.log(rawResponse);
const response = await rawResponse.json();
const toBeDeleted = response.revisions.sort((a, b) => (new Date(b.createTime) - new Date(a.createTime))).slice(1);
const deletionPromises = [];
for(const revision of toBeDeleted) {
Expand Down

0 comments on commit beef513

Please sign in to comment.