Skip to content

Commit

Permalink
add get-package-info action
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarrku committed Nov 5, 2021
1 parent 41d85ed commit 45aa50f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions get-package-info/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Get Package Info
description: Gets JSON info of the release
outputs:
json:
description: "JSON output of package info"
value: ${{ steps.set-info.outputs.result }}
runs:
using: "composite"
steps:
- name: Set Info
uses: actions/github-script@v5
id: set-info
with:
script: |
const tag = context.payload.release.tag_name;
const idx = tag.lastIndexOf('@');
const pkgName = tag.substring(0, idx);
const version = tag.substring(idx + 1);
const isPrerelease = version.includes('-') && !version.includes('hotfix');
return {pkgName,version,isPrerelease}

0 comments on commit 45aa50f

Please sign in to comment.