From 070785634fb712b9517c3df442d716d193d8e147 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 18 Sep 2022 20:32:20 +0100 Subject: [PATCH] Debugging how to get tag --- .github/workflows/release-tag.yml | 42 +++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index b68ca43..b7ddd06 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -1,24 +1,40 @@ name: release-tag on: push: - tags: - - "**" +# tags: +# - "**" + +# jobs: +# create-release: +# runs-on: ubuntu-latest +# permissions: +# contents: write +# steps: +# # https://github.com/actions/github-script +# - uses: actions/github-script@v6 +# with: +# # https://octokit.github.io/rest.js/v18#repos-create-release +# script: | +# github.rest.repos.createRelease({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# tag_name: github.ref_name, +# prerelease: !github.ref_name.match(/\d+\.\d+\.\d+$/), +# body: 'Please see the [changelog](https://zero-to-jupyterhub.readthedocs.io/en/latest/changelog.html) for details.' +# }); + jobs: - create-release: + debug: runs-on: ubuntu-latest - permissions: - contents: write steps: # https://github.com/actions/github-script - uses: actions/github-script@v6 with: - # https://octokit.github.io/rest.js/v18#repos-create-release script: | - github.rest.repos.createRelease({ - owner: context.repo.owner, - repo: context.repo.repo, - tag_name: github.ref_name, - prerelease: !github.ref_name.match(/\d+\.\d+\.\d+$/), - body: 'Please see the [changelog](https://zero-to-jupyterhub.readthedocs.io/en/latest/changelog.html) for details.' - }); + console.log(context) + if (!context.ref.startsWith('refs/tags/')) { + core.setFailed(`${context.ref} is not in the form refs/tags/$tag`) + } + let tag = context.ref.slice(10) + console.log(tag) \ No newline at end of file