-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
75 lines (62 loc) · 2.29 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
70
71
72
73
74
75
name: 'Setup git credentials'
description: 'Authenticates git through 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.credentials.outputs.name }}
token:
description: 'The GitHub token of the app.'
value: ${{ steps.credentials.outputs.token }}
git-name:
description: 'The name to use with git.'
value: ${{ steps.credentials.outputs.git-name }}
git-email:
description: 'The email to use with git.'
value: ${{ steps.credentials.outputs.git-email }}
runs:
using: composite
steps:
- uses: myparcelnl/actions/setup-app-credentials@v4
id: credentials
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 git credentials'
shell: bash
env:
GIT_NAME: ${{ steps.credentials.outputs.git-name }}
GIT_EMAIL: ${{ steps.credentials.outputs.git-email }}
GIT_TOKEN: ${{ steps.credentials.outputs.token }}
#language=bash
run: |
git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"
git config --global user.password "$GIT_TOKEN"
echo "GIT_USER=$GIT_NAME:$GIT_TOKEN" >> $GITHUB_ENV
echo "GIT_AUTHOR_NAME=$GIT_NAME" >> $GITHUB_ENV
echo "GIT_AUTHOR_EMAIL=$GIT_EMAIL" >> $GITHUB_ENV
echo "GIT_COMMITTER_NAME=$GIT_NAME" >> $GITHUB_ENV
echo "GIT_COMMITTER_EMAIL=$GIT_EMAIL" >> $GITHUB_ENV