docs: sfw enterprise requires socket-token #31
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Alias | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
permissions: | |
contents: read # for checkout | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
steps: | |
- name: github auth | |
id: bot | |
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 | |
with: | |
app-id: ${{ secrets.GH_BOT_APP_ID }} | |
private-key: ${{ secrets.GH_BOT_APP_PEM_FILE }} | |
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd | |
with: | |
github-token: ${{ steps.bot.outputs.token }} | |
script: | | |
const version = context.ref.replace('refs/tags/v', '') | |
const [major, minor, patch] = version.split('.') | |
core.debug(`${context.ref} -> major: ${major}, minor: ${minor} patch" ${patch}`) | |
for (const version of [major, `${major}.${minor}`]) { | |
// delete existing tag | |
await github.rest.git.deleteRef({ ...context.repo, ref: `tags/v${version}` }).catch(() => {}) | |
// create new tag | |
await github.rest.git.createRef({ ...context.repo, ref: `refs/tags/v${version}` , sha: context.sha }) | |
} | |
// create a release from major version and set as latest | |
await github.rest.repos.createRelease({ ...context.repo, tag_name: `v${major}`, make_latest: 'true' }) |