react-emoji-textarea ใฎ้–‹็™บใ‚’่กŒใฃใŸ้š›ใ€ใƒชใƒชใƒผใ‚นใ‚’ไฝœๆˆใ—ใŸใ‚‰่‡ชๅ‹•็š„ใซ Node.js ใƒ‘ใƒƒใ‚ฑใƒผใ‚ธใซใƒฉใ‚คใƒ–ใƒฉใƒชใŒๅ…ฌ้–‹ใ•ใ‚Œใ‚‹ไป•็ต„ใฟใŒใปใ—ใ„ใจ่€ƒใˆใ€GitHub Actions ใงใใ‚Œใ‚’ๅฎŸ็พใ™ใ‚‹ใ“ใจใซใ—ใพใ—ใŸใ€‚

ใใฎ้š›ใ€ๅ…ฌๅผใ‚ตใ‚คใƒˆใซ ๅ…ฌ้–‹ใ•ใ‚Œใฆใ„ใ‚‹ๅ†…ๅฎน ใ‚’ๅ‚่€ƒใซ GitHub Actions ใ‚’ไฝœๆˆใ—ใŸใฎใงใ™ใŒใ€ใใฎใพใพๅˆฉ็”จใ™ใ‚‹ใจ็งใฎ็’ฐๅขƒใงใฏไธ‹่จ˜ใฎใ‚จใƒฉใƒผใŒ็™บ็”Ÿใ—ใฆใ—ใพใ„ใพใ—ใŸใ€‚

error Couldn't publish package: "https://registry.yarnpkg.com/@nikaera/react-emoji-textarea: You do not have permission to publish \"react-emoji-textarea\". Are you logged in as the correct user?"

ไธŠ่จ˜ใฎใ‚จใƒฉใƒผใซใคใ„ใฆ่ชฟๆŸปใ—ใชใŒใ‚‰ๆ”นไฟฎใ—ใŸใจใ“ใ‚ใ€ๆœ€็ต‚็š„ใซไธ‹่จ˜ใฎ GitHub Actions ใง Node.js ใƒ‘ใƒƒใ‚ฑใƒผใ‚ธใ‚’ๅ…ฌ้–‹ใงใใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ—ใŸใ€‚secrets.NPM_TOKEN ใซใฏ NPM Token ใ‚’็™ป้Œฒใ—ใพใ™ใ€‚

name: Node.js Package
on:
  # workflow_dispatch ใ‚’่ฟฝๅŠ ใ—ใฆๆ‰‹ๅ‹•ใงใ‚‚ๅฎŸ่กŒใงใใ‚‹ใ‚ˆใ†ๆ”นไฟฎ
  workflow_dispatch:
  release:
    types: [created]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: "14.x"
          registry-url: "https://registry.npmjs.org"
          # registry.npmjs.org ใธใ‚ขใ‚ฏใ‚ปใ‚นใ™ใ‚‹้š›ใฏๅฟ…ใš่ช่จผใ‚’่ฉฆใฟใ‚‹ใ‚ชใƒ—ใ‚ทใƒงใƒณใ‚’่ฟฝๅŠ 
          always-auth: true
          # scope ใซใฏ่‡ชๅˆ†ใฎใƒฆใƒผใ‚ถๅใ‚’ๆŒ‡ๅฎš
          scope: "@nikaera"
        # .npmrc ใซ https://registry.npmjs.org ใ‚ขใ‚ฏใ‚ปใ‚นๆ™‚ใซๅˆฉ็”จใ™ใ‚‹่ช่จผๆƒ…ๅ ฑใ‚’่จ˜่ผ‰ใ™ใ‚‹
      - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
      - name: Build react-emoji-textarea ๐Ÿ˜†๐Ÿ’–
        run: |
          yarn install --frozen-lockfile
          yarn format
          yarn build          
      - run: yarn publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}