Skip to content

Commit

Permalink
Debugging how to get tag
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Sep 18, 2022
1 parent ba5e155 commit 1550a19
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 1550a19

Please sign in to comment.