|
|
@@ -10,33 +10,23 @@ inputs:
|
|
|
outputs:
|
|
|
token:
|
|
|
description: "GitHub App token"
|
|
|
- value: ${{ steps.app-token.outputs.token }}
|
|
|
+ value: ${{ steps.apptoken.outputs.token }}
|
|
|
app-slug:
|
|
|
description: "GitHub App slug"
|
|
|
- value: ${{ steps.app-token.outputs.app-slug }}
|
|
|
- user-id:
|
|
|
- description: "GitHub App user id"
|
|
|
- value: ${{ steps.get-user-id.outputs.user-id }}
|
|
|
+ value: ${{ steps.apptoken.outputs.app-slug }}
|
|
|
runs:
|
|
|
using: "composite"
|
|
|
steps:
|
|
|
- name: Create app token
|
|
|
- id: app-token
|
|
|
+ id: apptoken
|
|
|
uses: actions/create-github-app-token@v2
|
|
|
with:
|
|
|
app-id: ${{ inputs.opencode-app-id }}
|
|
|
private-key: ${{ inputs.opencode-app-secret }}
|
|
|
|
|
|
- - name: Get GitHub App user id
|
|
|
- id: get-user-id
|
|
|
- run: |
|
|
|
- echo "user-id=$(gh api \"/users/${{ steps.app-token.outputs.app-slug }}%5Bbot%5D\" --jq .id)" >> "$GITHUB_OUTPUT"
|
|
|
- shell: bash
|
|
|
- env:
|
|
|
- GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
|
-
|
|
|
- name: Configure git user
|
|
|
run: |
|
|
|
- git config --global user.name "${{ steps.app-token.outputs.app-slug }}[bot]"
|
|
|
- git config --global user.email "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
|
|
|
+ slug="${{ steps.apptoken.outputs.app-slug }}"
|
|
|
+ git config --global user.name "${slug}[bot]"
|
|
|
+ git config --global user.email "${slug}[bot]@users.noreply.github.com"
|
|
|
shell: bash
|