mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
49 lines
1.7 KiB
YAML
49 lines
1.7 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_lowercase:
|
|
description: "The author name in lowercase"
|
|
value: ${{ jobs.configure.outputs.lowercase_name }}
|
|
author_uppercase:
|
|
description: "The author name in uppercase"
|
|
value: ${{ jobs.configure.outputs.uppercase_name }}
|
|
|
|
jobs:
|
|
configure:
|
|
runs-on: ubuntu-slim
|
|
outputs:
|
|
name: ${{ steps.configure_git_author.outputs.name }}
|
|
email: ${{ steps.configure_git_author.outputs.email }}
|
|
lowercase_name: ${{ steps.retrieve_author.outputs.lowercase_name }}
|
|
uppercase_name: ${{ steps.retrieve_author.outputs.uppercase_name }}
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Retrieve author in uppercase
|
|
id: retrieve_author
|
|
run: |
|
|
UPPERCASE_AUTHOR=$(echo "${INPUTS_ACTOR}" | tr '[:lower:]' '[:upper:]')
|
|
LOWERCASE_AUTHOR=$(echo "${INPUTS_ACTOR}" | tr '[:upper:]' '[:lower:]')
|
|
echo "uppercase_name=${UPPERCASE_AUTHOR}" >> "$GITHUB_OUTPUT"
|
|
echo "lowercase_name=${LOWERCASE_AUTHOR}" >> "$GITHUB_OUTPUT"
|
|
env:
|
|
INPUTS_ACTOR: ${{ inputs.actor }}
|
|
- name: Configure Git author
|
|
id: configure_git_author
|
|
uses: Homebrew/actions/git-user-config@main
|
|
with:
|
|
token: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', steps.retrieve_author.outputs.uppercase_name)] }}
|