fix: switch from secrets to inputs in set-git-config

This commit is contained in:
2025-02-09 03:08:41 +02:00
parent e4301e4e3c
commit 02866a741d
2 changed files with 20 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ Sets Git configuration for actions.
| `token` | <p>GitHub token.</p> | `false` | `${{ github.token }}` |
| `username` | <p>GitHub username for commits.</p> | `false` | `github-actions` |
| `email` | <p>GitHub email for commits.</p> | `false` | `github-actions@github.com` |
| `is_fiximus` | <p>Whether to use the Fiximus bot.</p> | `false` | `false` |
### Outputs
@@ -21,6 +22,7 @@ Sets Git configuration for actions.
| `token` | <p>GitHub token.</p> |
| `username` | <p>GitHub username for commits.</p> |
| `email` | <p>GitHub email for commits.</p> |
| `is_fiximus` | <p>Whether to use the Fiximus bot.</p> |
### Runs
@@ -48,4 +50,10 @@ This action is a `composite` action.
#
# Required: false
# Default: github-actions@github.com
is_fiximus:
# Whether to use the Fiximus bot.
#
# Required: false
# Default: false
```

View File

@@ -19,6 +19,10 @@ inputs:
email:
description: 'GitHub email for commits.'
default: 'github-actions@github.com'
is_fiximus:
description: 'Whether to use the Fiximus bot.'
required: false
default: 'false'
outputs:
token:
@@ -30,6 +34,9 @@ outputs:
email:
description: 'GitHub email for commits.'
value: ${{ steps.bot.outputs.email }}
is_fiximus:
description: 'Whether to use the Fiximus bot.'
value: ${{ steps.bot.outputs.is_fiximus }}
runs:
using: composite
@@ -38,14 +45,13 @@ runs:
id: bot
shell: bash
run: |
if [ -n "${{ secrets.FIXIMUS_TOKEN }}" ]; then
echo "token=${{ secrets.FIXIMUS_TOKEN }}" >> $GITHUB_OUTPUT
echo "token=${{ inputs.token }}" >> $GITHUB_OUTPUT
echo "username=${{ inputs.username }}" >> $GITHUB_OUTPUT
echo "email=${{ inputs.email }}" >> $GITHUB_OUTPUT
if [ "${{ inputs.is_fiximus }}" != "false" ]; then
echo "username=fiximus" >> $GITHUB_OUTPUT
echo "email=github-bot@ivuorinen.net" >> $GITHUB_OUTPUT
else
echo "token=${{ inputs.token }}" >> $GITHUB_OUTPUT
echo "username=${{ inputs.username }}" >> $GITHUB_OUTPUT
echo "email=${{ inputs.email }}" >> $GITHUB_OUTPUT
fi
- name: Configure Git