Skip to content

Commit

Permalink
removing temp file
Browse files Browse the repository at this point in the history
  • Loading branch information
SonOfLope committed Mar 29, 2024
1 parent 84df611 commit 66d03c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/add-new-member.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ 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
Expand Down Expand Up @@ -43,7 +47,7 @@ jobs:
output_file: temp_user_module.tf
strict: true
variables: |
user=${{ github.event.sender.login }}
user=${{ github.event.inputs.github_username }}
github_email=${{ github.event.inputs.github_email }}
team_sre=${{ github.event.inputs.team_sre }}
team_webmasters=${{ github.event.inputs.team_webmasters }}
Expand All @@ -53,13 +57,15 @@ jobs:
run: |
echo "" >> terraform/users.tf
cat temp_user_module.tf >> terraform/users.tf
- name: Remove Temporary File
run: rm temp_user_module.tf

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "Add new member: ${{ github.event.sender.login }}"
title: "Add new member: ${{ github.event.inputs.github_username }}"
body: |
This PR adds a new user module for ${{ github.event.sender.login }} to `users.tf`. Please review the configuration and merge the PR to apply the changes.
branch: "add-user-${{ github.event.sender.login }}"
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 }}"
delete-branch: true
8 changes: 2 additions & 6 deletions terraform/templates/user_module_template.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ module "{{ user }}" {
github_role = "member"
teams = [
{ teamName = "members", teamRole = "member" },
{% if team_sre %}
{ teamName = "sre", teamRole = "member" },
{% endif %}
{% if team_webmasters %}
{ teamName = "webmasters", teamRole = "member" },
{% endif %}
{% if team_sre %}{ teamName = "sre", teamRole = "member" },{% endif %}
{% if team_webmasters %}{ teamName = "webmasters", teamRole = "member" },{% endif %}
]
cluster_name = var.cluster_name
cluster_role = "{{ cluster_role }}"
Expand Down

0 comments on commit 66d03c0

Please sign in to comment.