Skip to content

Commit 4925bc8

Browse files
committed
chore: extended commit message also for GitHub Actions
1 parent 7a79539 commit 4925bc8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ Learn more about ["personal access tokens" here](https://help.github.com/article
211211
- Example: `ng deploy --message="What could possibly go wrong?"`
212212

213213
The commit message **must be wrapped in quotes** if there are any spaces in the text.
214-
Some handy additional text is always added,
215-
if the environment variable `TRAVIS` exists (for Travis CI) or
216-
if the environment variable `CIRCLECI` exists (for Circle CI).
214+
Some additional text is always added to the message, if the command runs on Travis CI, Circle CI or GitHub Actions.
217215

218216
#### --branch <a name="branch"></a>
219217

src/engine/engine.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ export async function prepareOptions(
108108
process.env.CIRCLE_BUILD_URL;
109109
}
110110

111+
if (process.env.GITHUB_ACTIONS) {
112+
options.message +=
113+
'\n\n' +
114+
'Triggered by commit: https://github.com/' +
115+
process.env.GITHUB_REPOSITORY +
116+
'/' +
117+
'/commit/' +
118+
process.env.GITHUB_SHA;
119+
}
120+
111121
// NEW in 0.6.2: always discover remote URL (if not set)
112122
// this allows us to inject tokens from environment even if `--repo` is not set manually
113123
if (!options.repo) {

0 commit comments

Comments
 (0)