mirror of
https://github.com/immich-app/devtools.git
synced 2026-09-30 13:23:00 +08:00
* feat!: client-id input on create-workflow-token action * chore: add github secret for client_id --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
38 lines
1.1 KiB
YAML
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
|
|
|