-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
29 lines (29 loc) · 859 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Git as GitHub Actions Bot
description: Set git config's user as GitHub Actions bot
branding:
icon: git-commit
color: orange
inputs:
config-level:
description: git config's level
required: false
default: local
runs:
using: composite
steps:
- run: |
LEVELS=("system" "global" "local")
printf '%s\n' "${LEVELS[@]}" | grep -qx $LEVEL
if [ $? -eq 1 ]; then
echo "::error title=Unexpected input value::Input (config-level) can be set to 'system', 'local', or 'global'."
exit 1
fi
env:
LEVEL: ${{ inputs.config-level }}
shell: bash
- run: |
git config --$LEVEL user.email "github-actions[bot]@users.noreply.github.com"
git config --$LEVEL user.name "github-actions[bot]"
env:
LEVEL: ${{ inputs.config-level }}
shell: bash