Skip to content

Interactive comment that enable users to effortlessly execute specific GitHub Actions workflows.

License

Notifications You must be signed in to change notification settings

diegocatao/actions-shortcuts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Actions Shortcut

image
Pull Request comment that includes interactive actions shortcuts that enable users to effortlessly execute specific workflows.

This repository provides a versatile Cloudflare Worker script and GitHub Actions workflows designed to streamline various automation tasks within GitHub repositories. The Cloudflare Worker script can trigger Cypress workflows and Cloudflare Pages deployments, but its adaptability allows it to be used for a wide range of scenarios, which means: feel free to integrate per your needs.

The primary objective of this integration is to eliminate the need for navigating to the GitHub Actions page, manually selecting the desired action, and subsequently triggering it. Instead, the repository's ingenious design facilitates a direct and swift triggering of actions.


Getting started

1. Cloudflare Worker

Overview

The Cloudflare Worker script (worker.js) is designed to offer a comprehensive automation framework:

  • Authenticate with the GitHub API using a personal access token.
  • Handle incoming requests, making it a versatile tool for different triggers.
  • Validate requests based on parameters.
  • Fetch pull request details, comments, and other relevant information.
  • Update comments with dynamic content, such as Cloudflare Pages deployments and Cypress information

Setting up

Script example

  1. Deploy the Cloudflare Worker script:
    • Sign up for a Cloudflare account and create a new Worker.
    • Copy the contents of worker.js into the Worker editor.
    • Modify constants and functions to match your specific requirements.
  2. Set up environment variables:
    • Make sure to set up your worker's variables (GHA_TOKEN, FOUND_STATUS_CODE, and others).
    • In case you're building something different, feel free to customize these variables to tailor the Worker to your use case.
  3. Deploy the Cloudflare Worker and note the provided URL.

2. GitHub Actions

The primary function of the workflow is to create the initial comment when a pull request is first opened. This comment serves as a central hub for information related to the pull request, including Cloudflare Pages deployments and Cypress test run links.

Workflow example

Workflow helper example

Usage

Adapt workflows to your needs:

  • Customize environment variables like CF_PAGES_WORKFLOW_BASE_URL and CYPRESS_WORKFLOW_BASE_URL.

Customization

This automation framework's adaptability extends beyond the initial comment creation. The versatile architecture can be easily customized for various use cases. You can modify the provided scripts, adapt workflows, and configure environment variables to match your project's unique needs.

Contributing

Contributions are highly encouraged! Feel free to open issues for questions, suggestions, or bug reports. Pull requests that enhance or extend the capabilities of this automation framework are welcome.

License

This project is licensed under the MIT License.

About

Interactive comment that enable users to effortlessly execute specific GitHub Actions workflows.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published