Files
SwiftLint/.github/workflows/actor-credentials.yml
2025-04-05 15:40:12 +02:00

41 lines
1.3 KiB
YAML

name: Actor Credentials
on:
workflow_call:
inputs:
actor:
required: true
type: string
description: 'GitHub actor to use for configuration and authoring'
outputs:
author_name:
description: "The Git author name"
value: ${{ jobs.configure.outputs.name }}
author_email:
description: "The Git author email"
value: ${{ jobs.configure.outputs.email }}
author_uppercase:
description: "The author name in uppercase"
value: ${{ jobs.configure.outputs.uppercase_name }}
jobs:
configure:
runs-on: ubuntu-24.04
outputs:
name: ${{ steps.configure_git_author.outputs.name }}
email: ${{ steps.configure_git_author.outputs.email }}
uppercase_name: ${{ steps.retrieve_author.outputs.name }}
permissions:
contents: write
steps:
- name: Retrieve author in uppercase
id: retrieve_author
run: |
AUTHOR=$(echo ${{ inputs.actor }} | tr '[:lower:]' '[:upper:]')
echo "name=${AUTHOR}" >> "$GITHUB_OUTPUT"
- name: Configure Git author
id: configure_git_author
uses: Homebrew/actions/git-user-config@master
with:
token: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', steps.retrieve_author.outputs.name)] }}