From 1550a197839390cf880bf68d9c8b8342b14d91c7 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 18 Sep 2022 20:30:06 +0100 Subject: [PATCH] Debugging how to get tag --- .github/workflows/release-tag.yml | 40 +++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index b68ca43..ea87ac4 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -1,24 +1,38 @@ 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) + console.assert(context.ref.startsWith('refs/tags/'), `${context.ref} is not refs/tags/$tag`) + let tag = context.ref.slice(10) + console.log(tag) \ No newline at end of file