From 94cf2673ab2fd69a711b09158b264aa0e99be49d Mon Sep 17 00:00:00 2001 From: ale5000 <15793015+ale5000-git@users.noreply.github.com> Date: Tue, 21 Jan 2025 01:08:54 +0100 Subject: [PATCH] Update auto-nightly.yml --- .github/workflows/auto-nightly.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/auto-nightly.yml b/.github/workflows/auto-nightly.yml index c3d3d7b4..35b8234e 100644 --- a/.github/workflows/auto-nightly.yml +++ b/.github/workflows/auto-nightly.yml @@ -24,21 +24,14 @@ jobs: with: retries: 3 script: | - github.rest.git.updateRef({ + await github.rest.git.updateRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'refs/tags/nightly', sha: context.sha }).catch(error => { - console.log('Error message: ' + error.message) - console.log('Error message: ' + error.status) - return - if(error.status == 422 && error.message == 'Reference already exists') { - console.log('::warning::Tag already exist, ignored!!!') - return - throw error - } - github.rest.git.createRef({ + if(error.status !== 422 || error.message !== 'Reference does not exist') throw error + await github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'refs/tags/nightly',