Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
47 lines (41 loc) · 1.61 KB
/
Copy pathaction.yml
File metadata and controls
47 lines (41 loc) · 1.61 KB
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
name: Setup GitHub App Git auth
description: Generate a ProcessMaker CICD app token, configure git/gh for bot commits, and export GH_TOKEN
inputs:
private-key:
description: Private key for the ProcessMaker CICD GitHub App (pass secrets.PM_CICD_APP_PRIVATE_KEY)
required: true
repositories:
description: Optional comma/newline-separated repo list to scope the token. Omit for all repos in the ProcessMaker installation.
required: false
outputs:
token:
description: The generated app token
value: ${{ steps.app-token.outputs.token }}
app-slug:
description: The slug of the GitHub App
value: ${{ steps.app-token.outputs.app-slug }}
runs:
using: composite
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: Iv23liEEWBEvXnSckkld
private-key: ${{ inputs.private-key }}
owner: ProcessMaker
repositories: ${{ inputs.repositories }}
- id: get-user-id
shell: bash
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
user_id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)
echo "user-id=$user_id" >> "$GITHUB_OUTPUT"
- shell: bash
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
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'
gh auth setup-git
echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"