-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
69 lines (56 loc) · 1.97 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: 'Generate app credentials'
description: 'Generate credentials and git committer details for a GitHub app.'
inputs:
app-id:
description: 'The app ID of the app.'
required: true
private-key:
description: 'The private key of the app.'
required: true
owner:
description: 'The owner of the GitHub App installation (defaults to current repository owner)'
required: false
repositories:
description: 'Repositories to install the GitHub App on (defaults to current repository if owner is unset)'
required: false
skip-token-revoke:
description: 'If truthy, the token will not be revoked when the current job is complete'
required: false
github-api-url:
description: 'The URL of the GitHub REST API.'
default: ${{ github.api_url }}
outputs:
name:
description: 'The name of the app.'
value: ${{ steps.generate-token.outputs.app-slug }}
token:
description: 'The GitHub token of the app.'
value: ${{ steps.generate-token.outputs.token }}
git-name:
description: 'The name to use with git.'
value: ${{ steps.create-outputs.outputs.git-name }}
git-email:
description: 'The email to use with git.'
value: ${{ steps.create-outputs.outputs.git-email }}
runs:
using: composite
steps:
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ inputs.app-id }}
private-key: ${{ inputs.private-key }}
owner: ${{ inputs.owner }}
repositories: ${{ inputs.repositories }}
skip-token-revoke: ${{ inputs.skip-token-revoke }}
github-api-url: ${{ inputs.github-api-url }}
- name: 'Set outputs'
id: create-outputs
shell: bash
env:
APP_SLUG: ${{ steps.generate-token.outputs.app-slug }}
#language=bash
run: |
GIT_NAME="$APP_SLUG[bot]"
echo "git-name=$GIT_NAME" >> $GITHUB_OUTPUT
echo "[email protected]" >> $GITHUB_OUTPUT