Skip to content

Commit

Permalink
Retrieve author information with Homebrew action
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny committed Jan 17, 2025
1 parent a1bff9b commit a1c27db
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
prepare-release:
name: Prepare Release
runs-on: ubuntu-24.04
outputs:
author_uppercase: ${{ steps.retrieve_author.outputs.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -36,10 +38,20 @@ jobs:
run: |
sed 's/__VERSION__/${{ inputs.version }}/g' tools/Version.swift.template > Source/SwiftLintFramework/Models/Version.swift
sed -i -e '3s/.*/ version = "${{ inputs.version }}",/' MODULE.bazel
- name: Retrieve author in uppercase
id: retrieve_author
run: |
AUTHOR=$(echo ${{ github.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)] }}
- name: Configure author
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "${{ steps.configure_git_author.outputs.name }}"
git config --local user.email "${{ steps.configure_git_author.outputs.email }}"
- name: Commit changes
id: pre_release
run: |
Expand Down Expand Up @@ -76,6 +88,7 @@ jobs:
create-release:
name: Create Release
needs:
- prepare-release
- build-docker
- build-macos
runs-on: macOS-14
Expand Down Expand Up @@ -117,15 +130,10 @@ jobs:
git tag -a "${{ inputs.version }}" -m "${{ inputs.title }}"
git push origin HEAD
git push origin "${{ inputs.version }}"
- name: Retrieve author in uppercase
id: retrieve_author
run: |
AUTHOR=$(echo ${{ github.actor }} | tr '[:lower:]' '[:upper:]')
echo "name=${AUTHOR}" >> $GITHUB_OUTPUT
- name: Create release
run: ./tools/create-github-release.sh "${{ inputs.version }}"
env:
GITHUB_TOKEN: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', steps.retrieve_author.outputs.name)] }}
GITHUB_TOKEN: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', needs.prepare-release.outputs.author_uppercase)] }}
- name: Add new changelog section
run: |
./tools/add-new-changelog-section.sh
Expand Down

0 comments on commit a1c27db

Please sign in to comment.