diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a3d136f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +* @quickcase/dev +/.github/ @quickcase/ops diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca4dc6f..8cfff88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,9 @@ on: - cron: '0 0 * * *' permissions: contents: read +env: + NODE_VERSION: 20 + jobs: quality_checks: name: Quality checks @@ -20,10 +23,10 @@ jobs: node: [16, 18, 20] steps: - name: Checkout - uses: actions/checkout@v6.0.3 + uses: actions/checkout@v6 - name: Setup NodeJS ${{ matrix.node }} - uses: actions/setup-node@v4.0.2 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node }} cache: 'npm' @@ -39,12 +42,12 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@v6.0.3 + uses: actions/checkout@v6 - - name: Setup NodeJS 20 - uses: actions/setup-node@v4.0.2 + - name: Setup NodeJS + uses: actions/setup-node@v6 with: - node-version: '20' + node-version: ${{ env.NODE_VERSION }} cache: 'npm' - name: Audit dependencies @@ -57,7 +60,7 @@ jobs: timeout-minutes: 10 steps: - name: Checkout - uses: actions/checkout@v6.0.3 + uses: actions/checkout@v6 - name: Lint Code Base uses: github/super-linter/slim@v5 @@ -76,12 +79,12 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@v6.0.3 + uses: actions/checkout@v6 - - name: Setup NodeJS 20 - uses: actions/setup-node@v4.0.2 + - name: Setup NodeJS + uses: actions/setup-node@v6 with: - node-version: '20' + node-version: ${{ env.NODE_VERSION }} cache: 'npm' registry-url: https://registry.npmjs.org scope: '@quickcase' @@ -96,61 +99,3 @@ jobs: run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - end: - name: End - needs: [quality_checks, security_checks, lint, publish] - if: always() - runs-on: ubuntu-latest - timeout-minutes: 5 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - steps: - - name: Build summary - id: summary - env: - QUALITY: ${{ needs.quality_checks.result }} - SECURITY: ${{ needs.security_checks.result }} - LINT: ${{ needs.lint.result }} - PUBLISH: ${{ needs.publish.result }} - run: | - echo "success=$(if [[ "$QUALITY$SECURITY$LINT$PUBLISH" =~ ^(success|skipped)+$ ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT - - name: Notify slack fail - if: steps.summary.outputs.success != 'true' && env.SLACK_BOT_TOKEN != 0 - uses: slackapi/slack-github-action@v1.25.0 - with: - channel-id: dev - payload: | - { - "text": "${{github.repository}}: CI failed", - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "emoji": true, - "text": ":x: ${{github.repository}}: CI failed" - } - }, - { - "type": "context", - "elements": [ - { - "type": "mrkdwn", - "text": "Repository: <${{github.server_url}}/${{github.repository}}|${{github.repository}}>" - }, - { - "type": "mrkdwn", - "text": "Triggered by: *${{github.triggering_actor}}*" - } - ] - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "See failed run: <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}|${{github.run_id}}>" - } - } - ] - }