diff options
| author | Dax Raad <[email protected]> | 2026-01-29 23:49:53 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-01-29 23:49:53 -0500 |
| commit | 2d3c7a0f24754ea0643d9bfd6dec2df39623763f (patch) | |
| tree | c69a6efa33ea46c2384f174d0857cd4dd5ac966d /.github/actions | |
| parent | cd664a189b7c1de5232b58c180fca72b86adada6 (diff) | |
| download | opencode-2d3c7a0f24754ea0643d9bfd6dec2df39623763f.tar.gz opencode-2d3c7a0f24754ea0643d9bfd6dec2df39623763f.zip | |
ci
Diffstat (limited to '.github/actions')
| -rw-r--r-- | .github/actions/setup-git-committer/action.yml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/.github/actions/setup-git-committer/action.yml b/.github/actions/setup-git-committer/action.yml new file mode 100644 index 000000000..39374e167 --- /dev/null +++ b/.github/actions/setup-git-committer/action.yml @@ -0,0 +1,42 @@ +name: "Setup Git Committer" +description: "Create app token and configure git user" +inputs: + opencode-app-id: + description: "OpenCode GitHub App ID" + required: true + opencode-app-secret: + description: "OpenCode GitHub App private key" + required: true +outputs: + token: + description: "GitHub App token" + value: ${{ steps.app-token.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 }} +runs: + using: "composite" + steps: + - name: Create app token + id: app-token + 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 }}[bot]\" --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" + shell: bash |
