Skip to content

Github Action to trigger GitHub Deployments with PR comments

License

Notifications You must be signed in to change notification settings

alexjurkiewicz/pr-comment-github-deployment

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

GitHub Action for PR Comment -> GitHub Deployment Workflow

This is a GitHub Action. You can use it to watch your pull requests for comments with a certain trigger phrase, which will trigger a deployment.

Example

on: issue_comment

jobs:
  deploy:
    steps:
      - uses: alexjurkiewicz/pr-comment-github-deployment@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Parameters

Parameter Required Description
trigger_phrase Optional. Default: deploy to Trigger phrase you want to activate on. This action will take the remainder of the comment body as the environment, eg a message of deploy to web3 will trigger a deployment to web3.
environment_validation_file Optional. Default: unset If specified, this is a JSON file in your repository that defines a whitelist of acceptable environments, as well as metadata about them. See below for more info.
allow_draft Optional. Default: false If set to true, you can deploy draft PRs.
ignore_status_checks Optional. Default: false If set to true, you can deploy PRs with pending/failed status checks.
comment Optional. Default: true If set to false, comments will not be posted to the pull request.

Environment Variables

You must pass in GITHUB_TOKEN. It requires read & write access to both the head and base repositories of the pull request.

Outputs

If you give this action's step an id, you can access the following outputs:

Output Description
deployment_id GitHub's ID for this deployment.
deployment_api_url URL to read deployment information.

environment_validation_file

The purpose of this file is to prevent deployments to non-existent / restricted environments. Use a format like this:

[
  {
    "name": "production", // Required.
    "transient": false,   // Optional (default: false). Specifies if the given
                          // environment is specific to the deployment and will
                          // no longer exist at some point in the future.
    "production": true,   // Optional (default: false). Specifies if the given
                          // environment is one that end-users directly interact
                          // with.
  },
  { "name": "test" },
  { "name": "test-temp", "transient": true }
]

Release Policy

This GitHub Action follows will never break backwards compatibility. Use master as the version specifier for this action in your workflows.

(If backwards compatibility has to be broken, a new repository will be started.)

About

Github Action to trigger GitHub Deployments with PR comments

Resources

License

Stars

Watchers

Forks

Packages

No packages published