-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 1.97 KB
/
add-new-member.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
name: Ajouter un nouveau membre à l'organisation
on:
workflow_dispatch:
inputs:
github_username:
description: 'GitHub username'
required: true
type: string
github_email:
description: 'GitHub Email'
required: true
type: string
team_sre:
description: 'Add to SRE team?'
required: false
type: boolean
cluster_role:
description: 'Cluster Role'
required: true
type: choice
options:
- None
- Reader
- Operator
- Admin
jobs:
create_pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Render Terraform User Module
uses: cuchi/[email protected]
with:
template: terraform/templates/user_module_template.jinja2
output_file: temp_user_module.tf
strict: true
variables: |
user=${{ github.event.inputs.github_username }}
github_email=${{ github.event.inputs.github_email }}
team_sre=${{ github.event.inputs.team_sre }}
cluster_role=${{ github.event.inputs.cluster_role }}
- name: Append New User Module to users.tf
run: cat temp_user_module.tf >> terraform/users.tf
- name: Remove Temporary File
run: rm temp_user_module.tf
- name: echo file
run: cat terraform/users.tf
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v5
with:
title: "Add new member: ${{ github.event.inputs.github_username }}"
body: |
This PR adds a new user module for ${{ github.event.inputs.github_username }} to `users.tf`. Please review the configuration and merge the PR to apply the changes.
branch: "add-user-${{ github.event.inputs.github_username }}"
team-reviewers: |
Exec
token: ${{ secrets.PULL_REQUEST_TOKEN }}