Skip to content

Extend logs

Extend logs #4

name: Reusable Node.js Package Workflow
on:
workflow_call:
inputs:
node_version:
type: string
required: true
registry_url:
type: string
required: true
scope:
type: string
default: 'openimis'
access:
type: string
default: 'public'
secrets:
GITHUB_TOKEN:

Check failure on line 19 in .github/workflows/module-gprpublish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/module-gprpublish.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
scope: ${{ inputs.scope }}
- name: Update version with TAG
run: |
TAG_NAME=$(git tag --sort=-version:refname | head -n 1)
echo $TAG_NAME
echo $(jq --arg a "$TAG_NAME" '.version = ($a)' package.json) > package.json
- run: yarn install
- run: yarn build
- name: Publish to GPR
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY_URL: 'https://npm.pkg.github.com/'
# Use example
# name: Implement Node.js Package Workflow
# on:
# release:
# types: [published]
# jobs:
# call-central-workflow:
# uses: openimis/openimis-fe_js/.github/workflows/module-gprpublish.yml@develop
# with:
# node_version: '18'
# registry_url: 'https://registry.npmjs.org/'
# access: 'public'
# scope: 'openimis'
# publish_to_gpr: true
# secrets:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}