Skip to content

Commit

Permalink
Feature/7 move snapshot tag (#32)
Browse files Browse the repository at this point in the history
* [#7] Move snapshot tag dynamically
  • Loading branch information
davidlukac authored Aug 27, 2021
1 parent c299471 commit 4987189
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ jobs:
with:
env-file: .env

- name: Move snapshot tag
uses: actions/github-script@v4
with:
script: |
try {
await github.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/v${{ env.APP_VERSION }}-snapshot"
})
} catch (e) {
console.log("The snapshot tag doesn't exist yet: " + e)
}
await github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ env.APP_VERSION }}-snapshot",
sha: context.sha
})
if: github.ref == 'refs/heads/master'

- name: GoLang setup
uses: actions/setup-go@v2
with:
Expand Down

0 comments on commit 4987189

Please sign in to comment.