🔀 Merge #269 (⬆️ Bump actions/labeler from … #156
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 CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| test: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 14 | |
| cache: "npm" | |
| - name: Setup Licensed | |
| uses: licensee/setup-licensed@v1.3.2 | |
| with: | |
| version: 2.15.2 | |
| github_token: ${{ secrets.GH_PAT || github.token }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build TypeScript | |
| run: npm run build | |
| - name: Run tests | |
| run: npm run test | |
| - name: Check dependency licenses | |
| id: licensed | |
| uses: licensee/licensed-ci@v1.12.1 | |
| with: | |
| config_file: .github/licensed.yml | |
| github_token: ${{ secrets.GH_PAT || github.token }} | |
| user_name: "KojBot" | |
| user_email: "bot@koj.co" | |
| commit_message: ":page_facing_up: Update dependency license file [skip ci]" | |
| - name: Add PR comment | |
| uses: actions/github-script@v9 | |
| if: always() && steps.licensed.outputs.pr_number | |
| with: | |
| github-token: ${{ secrets.GH_PAT || github.token }} | |
| script: | | |
| const issueNumber = Number("${{ steps.licensed.outputs.pr_number }}"); | |
| if (issueNumber) { | |
| await github.rest.issues.createComment({ | |
| ...context.repo, | |
| issue_number: issueNumber, | |
| body: "I've checked the license of your new dependency and it looks good!" | |
| }); | |
| } |