Skip to content

Commit fdfa0db

Browse files
committed
chore: let auto-fix-git-user/email defaults reference env vars directly
1 parent b4c3a3c commit fdfa0db

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

action.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ inputs:
230230
auto-fix-git-user:
231231
description: |-
232232
Git username for the auto-fix commit.
233-
Defaults to ``$GITHUB_ACTOR`` (the user who triggered the workflow).
233+
Defaults to the value of ``$GITHUB_ACTOR``.
234234
Only used when ``auto-fix`` is ``true``.
235235
default: ''
236236
required: false
237237
auto-fix-git-email:
238238
description: |-
239239
Git email for the auto-fix commit.
240-
Defaults to ``$GITHUB_ACTOR_ID+$GITHUB_ACTOR@users.noreply.github.com``.
240+
Defaults to the value of ``$GITHUB_ACTOR_ID+$GITHUB_ACTOR@users.noreply.github.com``.
241241
Only used when ``auto-fix`` is ``true``.
242242
default: ''
243243
required: false
@@ -538,15 +538,13 @@ runs:
538538
^git update-index -q --refresh
539539
let has_changes = (^git diff-index --name-status --exit-code HEAD -- | complete | $in.exit_code == 1)
540540
if $has_changes {
541-
let actor_name = $env.GITHUB_ACTOR
542-
let actor_id = $env.GITHUB_ACTOR_ID
543541
let git_user_name = if ('${{ inputs.auto-fix-git-user }}' | is-empty) {
544-
$actor_name
542+
$env.GITHUB_ACTOR
545543
} else {
546544
'${{ inputs.auto-fix-git-user }}'
547545
}
548546
let git_user_email = if ('${{ inputs.auto-fix-git-email }}' | is-empty) {
549-
$"($actor_id)+($actor_name)@users.noreply.github.com"
547+
$"($env.GITHUB_ACTOR_ID)+($env.GITHUB_ACTOR)@users.noreply.github.com"
550548
} else {
551549
'${{ inputs.auto-fix-git-email }}'
552550
}

0 commit comments

Comments
 (0)