Skip to content

Fix Entra ID integration reply url - is nog localhost #5

Fix Entra ID integration reply url - is nog localhost

Fix Entra ID integration reply url - is nog localhost #5

Workflow file for this run

name: Provision Participant environment
on:
issues:
types:
- closed
workflow_dispatch:
inputs:
githubhandle:
required: true
type: text
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get issue creator
id: github_handle
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
if ("${{ github.event_name }}" == "issues") {
const subject = context.payload.issue;
if (subject.labels.find(l => l.name == "signup")) {
creator = subject.user.login;
console.log(`Issue creator: ${creator}`);
return creator;
}
throw new Error("Issue did not have a signup label");
}
return "${{ github.event.inputs.githubhandle }}";
- name: Install GH Collab
run: |
gh extension install mislav/gh-repo-collab
env:
GH_TOKEN: ${{ secrets.VSLIVE_REPOCREATE }}
- name: Create Repository
env:
GH_TOKEN: ${{ secrets.VSLIVE_REPOCREATE }}
run: |
# Create clone of this repo for user
repo_name="XpiritCommunityEvents/attendeello-${{ steps.github_handle.outputs.result }}"
if gh repo view $repo_name &>/dev/null; then
echo "Repository $repo_name already exists."
else
echo "Repository $REPO_NAME does not exist."
gh repo create $repo_name \
--public \
--template ${{ github.repository }}
fi
- name: Invite Member to Organization
env:
GH_TOKEN: ${{ secrets.VSLIVE_REPOCREATE }}
run: |
id=$(gh api users/${{ steps.github_handle.outputs.result }} --jq '.id')
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /orgs/XpiritCommunityEvents/invitations -F invitee_id=$id -f role='direct_member'
gh api --method PUT -H "Accept: application/vnd.github+json" /repos/XpiritCommunityEvents/LegacyLiftOffWorkshop/collaborators/${{ steps.github_handle.outputs.result }} -f permission='Attendee'
- name: Set Rights to Repo
env:
GH_TOKEN: ${{ secrets.VSLIVE_REPOCREATE }}
run: |
# Add user to newly cloned repo
gh repo-collab add XpiritCommunityEvents/attendeello-${{ steps.github_handle.outputs.result }} ${{ steps.github_handle.outputs.result }} --permission admin | cat
- name: Azure Login
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# - name: Create Azure resource
# uses: Azure/[email protected]
# with:
# inlineScript: |
# # Set variables
# RESOURCE_GROUP_NAME=rg-${{ steps.github_handle.outputs.result }}
# APP_SERVICE_PLAN_NAME=asp-${{ steps.github_handle.outputs.result }}
# WEBAPP_HMS="app-${{ steps.github_handle.outputs.result }}-hms"
# az group create -l eastus -n $RESOURCE_GROUP_NAME --tags vslive=2024
# # Create an App Service Plan
# az appservice plan create --name $APP_SERVICE_PLAN_NAME --resource-group $RESOURCE_GROUP_NAME --sku S1 --tags vslive=2024
# # Create Web Apps
# az webapp create --name $WEBAPP_HMS --resource-group $RESOURCE_GROUP_NAME --plan $APP_SERVICE_PLAN_NAME --tags vslive=2024
# - name: Run User Provisioning Script
# shell: pwsh
# run: |
# ./provisioning/gh-aad.ps1 -githubHandle ${{ steps.github_handle.outputs.result }} -AzureCredentialsJson '${{ secrets.AZURE_CREDENTIALS }}' -InitialPassword "${{ secrets.INITIALPASSWORD }}" -runLocal $false