Skip to content

Commit 3088d83

Browse files
committed
feat: show workflow name in deafult commit message
Ref: #64
1 parent 3f6e296 commit 3088d83

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Add a step like this to your workflow:
3535
cwd: './path/to/the/repo'
3636

3737
# The message for the commit
38-
# Default: 'Commit from GitHub Actions'
38+
# Default: 'Commit from GitHub Actions (name of the workflow)'
3939
message: 'Your commit message'
4040

4141
# The arguments for the `git rm` command (see the paragraph below for more info)

action.yml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ inputs:
2222
message:
2323
description: The message for the commit
2424
required: false
25-
default: Commit from GitHub Actions
2625
remove:
2726
description: Arguments for the git rm command
2827
required: false

src/main.ts

+5
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ async function checkInputs() {
162162
info(`> Using '${getInput('author_name')} <${getInput('author_email')}>' as author.`)
163163
// #endregion
164164

165+
// #region message
166+
setDefault('message', `Commit from GitHub Actions (${process.env.GITHUB_WORKFLOW})`)
167+
info(`> Using "${getInput('message')}" as commit message.`)
168+
// #endregion
169+
165170
// #region branch
166171
const branch = setDefault('branch', defaultBranch || '')
167172
if (isPR) info(`> Running for a PR, the action will use '${branch}' as ref.`)

0 commit comments

Comments
 (0)