Skip to content

Automatically update the latest tag to the HEAD on master. #3

Automatically update the latest tag to the HEAD on master.

Automatically update the latest tag to the HEAD on master. #3

Workflow file for this run

name: Update latest tag
on:
push:
branches:
- master
paths:
- '**.go'
- 'go.**'
- .github/workflows/update-tag.yaml
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Create latest
run: |
with:
script: |
# Deletion no-ops if it's not already there.
github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/latest',
sha: context.sha
}).catch(err => {
# We use create rather than update, because this ensures that the
# 'latest' tag is actually pushed to trigger the publication job.
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/latest',
sha: context.sha
});
})