Inspired by Cypress Screenshot & Video Upload to Slack.
This GitHub Action enables you to send screenshots or videos generated by Cypress directly to a specified Slack channel.
It utilizes the new Slack API, replacing the deprecated files.upload
method.
(Required) Slack bot token. For details, see bot tokens.
- Create a Slack app.
- Navigate to
OAuth & Permissions
>Scopes
>Bot Token Scopes
, and addchat:write
andfiles:write scopes
. - Install the app into your Slack workspace.
- Invite the bot to the channel where you want to send messages.
- Retrieve the
Bot User OAuth Token
from theOAuth & Permissions page
. - Add this token as a secret to your GitHub repository under
Settings
>Secrets
. - Incorporate this action into your GitHub workflow YAML file.
(Required) GitHub token to access pull request information.
(Required) The Slack channels where the messages will be sent.
The directory where screenshots/videos are stored.
Default: cypress
The message to be sent.
Default: "The Cypress test in the workflow you just triggered has failed.\nPlease check the screenshots in the thread.👇🏻"
.
The color of the quote line.
uses: Cynthiafan/slack-cypress-media-uploader@1.0.10
with:
token: ${{ secrets.SLACK_TOKEN }}
github-token: ${{ secret.GITHUB_TOKEN }}
channels: ''
uses: Cynthiafan/slack-cypress-media-uploader@1.0.10
if: failure()
with:
token: ${{ secrets.SLACK_TOKEN }}
github-token: ${{ secret.GITHUB_TOKEN }}
channels: ''