Skip to content

Commit

Permalink
Merge pull request #4 from baloise-copilot/feat/teamchange
Browse files Browse the repository at this point in the history
changing powershell script
  • Loading branch information
Solaflex authored Sep 19, 2024
2 parents 1a2001a + dee68f7 commit 206c189
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/license_management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@ jobs:
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v2

- name: Authenticate GitHub CLI
- name: Collecting membership information
shell: pwsh
run: |
Write-Host "Authenticating with GitHub CLI"
echo ${{ steps.get_workflow_token.outputs.token }} | gh auth login --with-token
echo ${{ steps.get_workflow_token.outputs.token }} | gh auth login --with-token
- name: Collecting membership information
shell: pwsh
run: |
Write-Host "Getting users from file"
$users = (Get-Content users.json | ConvertFrom-Json).PSObject.Properties.Name
Write-Host "Users: $users"
Expand All @@ -46,9 +43,6 @@ jobs:
$team_members = gh api orgs/${{ github.repository_owner }}/teams/copilot-licenced-users/members | ConvertFrom-Json | ForEach-Object { $_.login }
Write-Host "Team members: $team_members"
- name: Adding new members
shell: pwsh
run: |
# Add missing users to the team
Write-Host "Checking for missing users in team"
foreach ($user in $users) {
Expand All @@ -59,9 +53,6 @@ jobs:
}
}
- name: Removing old members
shell: pwsh
run: |
# Remove users not in the list
Write-Host "Checking for users to remove from team"
foreach ($member in $team_members) {
Expand Down

0 comments on commit 206c189

Please sign in to comment.