Skip to content

actions-marketplace-validations/Cynthiafan_slack-cypress-media-uploader

Repository files navigation

Slack Cypress Media Uploader

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.

Inputs

token

(Required) Slack bot token. For details, see bot tokens.

  1. Create a Slack app.
  2. Navigate to OAuth & Permissions > Scopes > Bot Token Scopes, and add chat:write and files:write scopes.
  3. Install the app into your Slack workspace.
  4. Invite the bot to the channel where you want to send messages.
  5. Retrieve the Bot User OAuth Token from the OAuth & Permissions page.
  6. Add this token as a secret to your GitHub repository under Settings > Secrets.
  7. Incorporate this action into your GitHub workflow YAML file.

github-token

(Required) GitHub token to access pull request information.

channels

(Required) The Slack channels where the messages will be sent.

workdir

The directory where screenshots/videos are stored.

Default: cypress

message-text

The message to be sent.

Default: "The Cypress test in the workflow you just triggered has failed.\nPlease check the screenshots in the thread.👇🏻".

color

The color of the quote line.

Example usage

Send all the time

uses: Cynthiafan/slack-cypress-media-uploader@1.0.10
  with:
    token: ${{ secrets.SLACK_TOKEN }}
    github-token: ${{ secret.GITHUB_TOKEN }}
    channels: ''

Send only when failed

uses: Cynthiafan/slack-cypress-media-uploader@1.0.10
if: failure()
with:
  token: ${{ secrets.SLACK_TOKEN }}
  github-token: ${{ secret.GITHUB_TOKEN }}
  channels: ''

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published