mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
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:
parent
d063d0dd5e
commit
2d60548ab1
1 changed files with 16 additions and 5 deletions
21
.github/workflows/update.yml
vendored
21
.github/workflows/update.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue