Skip to content

Commit

Permalink
[feat] add slack integration
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBoWu committed Mar 30, 2024
1 parent 8783043 commit 0b22268
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Lint
run: pnpm eslint .
# Ensure you have a lint script in your package.json

- name: Run Tests
continue-on-error: true
run: |
Expand All @@ -53,6 +53,26 @@ jobs:
export API_KEY=${{ secrets.API_KEY }}
pnpm exec playwright test
- name: Push Slack Notification
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_GITHUB_NOTIFICATION }}
payload: |
{
"text": "${{ github.repository }}: API Integration Tests have been completed. Check the results at github.com\/${{ github.repository }}\/actions\/runs\/${{ github.run_id }}"
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Upload Test Results
uses: actions/upload-artifact@v2
# if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down

0 comments on commit 0b22268

Please sign in to comment.