Files
devtools/actions/create-workflow-token/action.yml
T
bo0tzzandJason Rasmussen 01f896c435 feat!: client-id input on create-workflow-token action (#1567)
* feat!: client-id input on create-workflow-token action

* chore: add github secret for client_id

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
2026-05-06 16:30:34 +00:00

38 lines
1.1 KiB
YAML

name: 'Create workflow token'
description: 'Create an app token, with fallback to $\{{ github.token }}'
inputs:
client-id:
description: 'The GitHub App Client ID'
required: false
private-key:
description: 'The GitHub App private key (PEM format)'
required: false
outputs:
token:
description: 'The created token, or $\{{ github.token }} if creation failed'
value: ${{ steps.output.outputs.token }}
runs:
using: 'composite'
steps:
- name: Generate a token
id: app-token
continue-on-error: true
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ inputs.client-id }}
private-key: ${{ inputs.private-key }}
- name: Set output
id: output
shell: bash
run: |
if [ "${{ steps.app-token.outcome }}" == "success" ]; then
echo "Using generated app token"
echo "token=${{ steps.app-token.outputs.token }}" >> $GITHUB_OUTPUT
else
echo "Falling back to github.token"
echo "token=${{ github.token }}" >> $GITHUB_OUTPUT
fi