-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
79 lines (77 loc) · 3.13 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
76
77
78
name: 'Google workspace user to GitHub Org User'
description: 'Manage GitHub organisation membership with Google Workspace user accounts'
author: Chris Nesbitt-Smith
branding:
icon: user-check
inputs:
google-email-address:
description: 'Email address to assume to, needs to be an workspace admin'
required: true
google-credentials:
description: 'Base64d json as downloaded from the google service account creation step'
required: true
add-users:
description: 'Set to TRUE to add users to the github organisation'
required: true
remove-users:
description: 'Set to TRUE to remove users from the github organisation'
required: false
exit-code-on-missmatch:
description: 'Exit code to use when there is a mismatch, useful when combined with `ADD_USERS` and `REMOVE_USERS` to be used in a dry-run mode'
required: false
github-org:
description: 'GitHub Organization '
required: true
github-app-id:
description: 'GitHub App ID'
required: true
github-installation-id:
description: 'Github App Installation ID'
required: true
github-private-key:
description: 'Base64d private key as downloaded from github application registration step'
required: true
ignored-users:
description: 'Comma separated list of user ids to totally ignore always, useful for owners of an org you do not want accidentally removed'
required: false
github-token:
description: github token to use to pull the docker image secrets.GITHUB_TOKEN is probably fine
required: true
github-actor:
description: github actor to use to pull the docker image github.actor is probably fine
required: true
runs:
using: "composite"
steps:
- name: Login to docker.pkg.github.com
shell: bash
run: echo ${PASSWORD} | docker login --username ${USERNAME} --password-stdin docker.pkg.github.com
env:
USERNAME: ${{ inputs.github-actor }}
PASSWORD: ${{ inputs.github-token }}
- name: Run
run: |
docker run --rm \
-e GOOGLE_EMAIL_ADDRESS="$GOOGLE_EMAIL_ADDRESS" \
-e GOOGLE_CREDENTIALS="$GOOGLE_CREDENTIALS" \
-e ADD_USERS="$ADD_USERS" \
-e REMOVE_USERS="$REMOVE_USERS" \
-e EXIT_CODE_ON_MISMATCH="$EXIT_CODE_ON_MISMATCH" \
-e GITHUB_ORG="$GITHUB_ORG" \
-e GITHUB_APP_ID="$GITHUB_APP_ID" \
-e GITHUB_INSTALLATION_ID="$GITHUB_INSTALLATION_ID" \
-e GITHUB_PRIVATE_KEY="$GITHUB_PRIVATE_KEY" \
-e IGNORED_USERS="$IGNORED_USERS" \
docker.pkg.github.com/appvia/githubusermanager/githubusermanager:v1.0.5
shell: bash
env:
GOOGLE_EMAIL_ADDRESS: ${{ inputs.google-email-address }}
GOOGLE_CREDENTIALS: ${{ inputs.google-credentials }}
ADD_USERS: ${{ inputs.add-users }}
REMOVE_USERS: ${{ inputs.remove-users }}
EXIT_CODE_ON_MISMATCH: ${{ inputs.exit-code-on-missmatch }}
GITHUB_ORG: ${{ inputs.github-org }}
GITHUB_APP_ID: ${{ inputs.github-app-id }}
GITHUB_INSTALLATION_ID: ${{ inputs.github-installation-id }}
GITHUB_PRIVATE_KEY: ${{ inputs.github-private-key }}
IGNORED_USERS: ${{ inputs.ignored-users }}