chore: 🔧 taking GITHUB_token from npm token #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD & Semantic Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: 'yarn' | |
| - name: Install Dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run Security Audit (Critical Issues Only) | |
| run: yarn audit --level critical --groups dependencies | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| registry-url: "https://registry.npmjs.org/" | |
| cache: 'yarn' | |
| - name: Install Dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Publish package with Semantic Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npx semantic-release |