Skip to content

✂ A github action that takes full screen scrolling screenshots of custom or preview urls and uploads them to dropbox.

License

Notifications You must be signed in to change notification settings

raiyanyahya/screenshot

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✂ screenshot to dropbox

This GitHub Action takes a full screen scrolling screenshot of a given URL, uploads it to Dropbox and posts the image url as a comment on the associated pull request. It's useful for visualizing changes in a UI project, previewing a deployed staging environment, or any situation where a visual representation of the changes in a PR is helpful.

HXpiPI4.md.png

Prerequisites

To use this action, you must have the following:

A GitHub repository with a workflow that triggers on pull request events and a DropBox Access Token. The DropBox token should have the files.content.write and the sharing.write permission.

Recommended permissions

For the execution of this action, it must be able to comment on a PR.
This can be achieved with the following configuration in the action if the permissions are restricted:

permissions:
  issues: write
  pull-requests: write

Usage

To use this action in your workflow, follow these steps:

1.Navigate to the GitHub Marketplace and search for "Screenshot Action" or visit the action's GitHub Marketplace page directly.

2.Click the "Use latest version" button to add the action to your repository.

3.In your repository, create a .github/workflows directory if it doesn't already exist.

4.Add a new workflow file, e.g., screenshot_on_pr.yml.

5Include the following example workflow in your new file, replacing your-username with the action creator's GitHub username and https://example.com with the desired URL to capture a screenshot of:

name: Screenshot on PR

on:
  pull_request:
    types:
      - opened
      - synchronize

jobs:
  screenshot:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2

    - name: Take screenshot and post it on the PR
      uses: raiyanyahya/screenshot-action@master
      with:
        url: 'https://example.com'
        dropbox_token: ${{ secrets.DROPBOX_TOKEN }}
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This example workflow runs on pull request events with opened and synchronize types. It checks out the repository, captures a screenshot using the snapsht CLI tool, uploads it to DropBox and posts the image url as a comment on the pull request.

Configuration

Currently, this action takes a single required input:

url: The URL to capture a screenshot of. The GITHUB_TOKEN environment variable is also required and should be set to ${{ secrets.GITHUB_TOKEN }} to use the default token provided by GitHub Actions. The DROPBOX_TOKEN is stored as a repository secret.

Contributing

Contributions to this project are welcome! Please feel free to open issues or submit pull requests with bug fixes, improvements, or new features.

License

This project is licensed under the MIT License.

About

✂ A github action that takes full screen scrolling screenshots of custom or preview urls and uploads them to dropbox.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published