silver-enigma-wrq56g6qqprhg9pr #148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Register Participant Codespace | |
on: | |
issues: | |
types: | |
- closed | |
workflow_dispatch: | |
inputs: | |
codespace: | |
required: true | |
type: text | |
concurrency: | |
group: only-one-at-a-time | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get codespace name from issue title | |
id: codespace_name | |
if: success() | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
if ("${{ github.event_name }}" == "issues") { | |
const subject = context.payload.issue; | |
if (subject.labels.find(l => l.name == "provisioning")) { | |
codespace = subject.title; | |
console.log(`Codespace name: ${codespace}`); | |
return codespace; | |
} | |
throw new Error("Issue did not have a provisioning label"); | |
} | |
return "${{ github.event.inputs.codespace }}"; | |
- name: Azure Login | |
uses: azure/[email protected] | |
if: success() | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Register codespace as reply url in app registration | |
if: success() | |
shell: pwsh | |
run: | | |
./provisioning/add-codespace-to-app.ps1 -Codespace ${{ steps.codespace_name.outputs.result }} -AzureCredentialsJson '${{ secrets.AZURE_CREDENTIALS }}' |