ci/update: cleanup how we get nixvim-ci's user-info

Get id, name, & email in a single `user-info` step.
This commit is contained in:
Matt Sturgeon 2025-06-02 11:09:46 +01:00
parent d063d0dd5e
commit 2d60548ab1
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -50,16 +50,27 @@ jobs:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- name: Get GitHub App User ID
id: user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
- name: Get GitHub App user info
id: user-info
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
slug: ${{ steps.app-token.outputs.app-slug }}
run: |
name="$slug[bot]"
id=$(gh api "/users/$name" --jq .id)
{
echo "id=$id"
echo "name=$name"
echo "email=$id+$name@users.noreply.github.com"
} >> "$GITHUB_OUTPUT"
- name: Configure git
env:
name: ${{ steps.user-info.outputs.name }}
email: ${{ steps.user-info.outputs.email }}
run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
git config --global user.name "$name"
git config --global user.email "$email"
- name: Checkout repository
uses: actions/checkout@v4