[StepSecurity] Apply security best practices #2729
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: Node.js CI | |
| 'on': | |
| push: | |
| branches: | |
| - master | |
| - alpha | |
| - beta | |
| - renovate/** | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| env: | |
| FORCE_COLOR: 1 | |
| NPM_CONFIG_COLOR: always | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@v3 | |
| - name: Read .nvmrc | |
| run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
| id: nvm | |
| - name: Setup node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ steps.nvm.outputs.NVMRC }} | |
| - uses: bahmutov/npm-install@v1 | |
| - run: npm test | |
| - name: Upload coverage data to Codecov | |
| run: npm run coverage:report | |
| release: | |
| needs: verify | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@v3 | |
| - name: Read .nvmrc | |
| run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
| id: nvm | |
| - name: Setup node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ steps.nvm.outputs.NVMRC }} | |
| - uses: bahmutov/npm-install@v1 | |
| - name: semantic-release | |
| run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |