fix readme #4
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: smoke | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: 'Branch or SHA to build' | |
| required: false | |
| default: 'master' | |
| jobs: | |
| smoke: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@flexmonster' | |
| - run: npm ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - run: npm test | |
| - name: Notify Slack | |
| if: always() | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| STATUS: ${{ job.status }} | |
| REPO: ${{ github.repository }} | |
| REF: ${{ github.ref_name }} | |
| SHA: ${{ github.sha }} | |
| ACTOR: ${{ github.actor }} | |
| RUN: ${{ github.run_id }} | |
| run: | | |
| ICON=$([ "$STATUS" = "success" ] && echo ":white_check_mark:" || echo ":x:") | |
| SHORT_SHA=${SHA:0:7} | |
| URL="https://github.com/$REPO/actions/runs/$RUN" | |
| curl -fSs -X POST -H 'Content-Type: application/json' "$SLACK_WEBHOOK_URL" \ | |
| -d "{\"text\":\"$ICON *smoke* on \`$REPO@$REF\` ($SHORT_SHA) by $ACTOR — *$STATUS*\n<$URL|View run>\"}" |