Skip to content

Commit

Permalink
ci: use environment
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Apr 21, 2023
1 parent d2c04a5 commit 0a5ed10
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
jobs:
release:
runs-on: ubuntu-22.04
environment:
name: npm-release
url: ${{ steps.release_log.outputs.RELEASE_URL }}
permissions:
contents: read
id-token: write
Expand All @@ -32,3 +35,9 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
- id: release_log
run: |
package_name="@hiogawa/${{ inputs.package }}"
package_version=$(jq -r .version packages/${{ inputs.package }}/package.json)
echo "RELEASE_URL=https://www.npmjs.com/package/${package_name}/v/${package_version}" >> "$GITHUB_OUTPUT"

0 comments on commit 0a5ed10

Please sign in to comment.