Skip to content

Ajouter un nouveau membre à l'organisation #15

Ajouter un nouveau membre à l'organisation

Ajouter un nouveau membre à l'organisation #15

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 }}