Skip to content

Commit

Permalink
update tag finding logic
Browse files Browse the repository at this point in the history
Signed-off-by: omrishiv <[email protected]>
  • Loading branch information
omrishiv committed Jun 21, 2024
1 parent 024d79d commit a17529f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
# find previous tag by filtering out nightly tags and choosing the
# second to last tag (last one is the current release)
run: |
prev_tag=$(git tag | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
echo "PREVIOUS_TAG=$prev_tag" >> $GITHUB_ENV
prev_tag=$(git tag | grep "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
echo "PREVIOUS_NIGHTLY_TAG=$prev_tag" >> $GITHUB_ENV
- name: 'Clean up nightly releases'
uses: actions/github-script@v4
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const { owner, repo } = context.repo
const { data: { id } } = await github.repos.getReleaseByTag({ owner, repo, ${{ env.PREVIOUS_TAG }} })
const { data: { id } } = await github.repos.getReleaseByTag({ owner, repo, ${{ env.PREVIOUS_NIGHTLY_TAG }} })
await github.repos.deleteRelease({ owner, repo, release_id: id })

0 comments on commit a17529f

Please sign in to comment.