generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 54
File Based Post Deploy Messages #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The "temp" file path works and it even works in our Acceptance testing was done here: GrantBirki/actions-sandbox#55 |
jasonmacgowan
previously approved these changes
Jul 27, 2023
ianwinsemius
approved these changes
Jul 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
File Based Post Deploy Messages
This pull request enables the option for "file based" custom post deploy messages.
By enabling this, users of this Action should be fully shielded from the issue that persists on GitHub Action runners where env vars containing a lot of data cause things to go 💥 (#173).
This will also allow users to have complete, and full control over how their post deploy messages look and it will be in markdown format as well which is a huge bonus.
Usage 💻
This pull request introduces a new input parameter for this Action:
deploy_message_path
- The path to a markdown file which is used as a template for custom deployment messages. Example:".github/deployment_message.md"
By default, this Action will now look for a file at the
deploy_message_path
path. If the file exists, it will be used and rendered with nunjucks which is a Jinja like templating engine for NodeJS. If the file does not exist, then the default deploy comment process will take place which will be familiar for all users of this Action. If theDEPLOY_MESSAGE
env var is set, that will still be used, otherwise the default message structure is used. So the order of operations for the deployment comment that appears on PRs is now as follows:deploy_message_path
file is used and rendered via nunjucksDEPLOY_MESSAGE
env var is read and injected into the default comment body structureThe
deploy_message_path
file should be a markdown file by convention and since it gets rendered with nunjucks, a few helpful variables are available out of the box for you to use and to help structure your messages with.environment
- The name of the environment (String)environment_url
- The URL of the environment (String) {Optional}status
- The status of the deployment (String) -success
,failure
, orunknown
noop
- Whether or not the deployment is a noop (Boolean)ref
- The ref of the deployment (String)actor
- The GitHub username of the actor who triggered the deployment (String)You can also view the template file used in unit tests which is self-documenting
Tangentially related: #173