[AI-900] 챌린지 완료 인증 #39
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: On Workshop Completion Submitted | |
on: | |
issues: | |
types: | |
- opened | |
workflow_dispatch: | |
inputs: | |
issue-number: | |
description: "Issue number" | |
required: true | |
error-code: | |
description: "Error code. It should be between 0 and 8" | |
required: false | |
default: "" | |
permissions: | |
contents: read | |
id-token: write | |
issues: write | |
pull-requests: write | |
jobs: | |
verification: | |
name: "Verifying Workshop completion" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check event payload | |
shell: pwsh | |
run: | | |
$eventPayload = '${{ toJson(github) }}' | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Get GitHub access token | |
id: github-connect | |
shell: pwsh | |
run: | | |
$token = ./gha-scripts/Get-GitHubAccessToken.ps1 ` | |
-AccessTokenIDs "${{ vars.ACCESS_TOKEN_IDS }}" ` | |
-ApimBaseUrl "${{ vars.APIM_BASE_URL }}" ` | |
-ApimApiKey "${{ secrets.APIM_SUBSCRIPTION_KEY }}" | |
echo "::add-mask::$token" | |
echo "token=$token" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 | |
- name: Check issue details | |
id: issue | |
shell: pwsh | |
env: | |
GH_TOKEN: ${{ steps.github-connect.outputs.token }} | |
run: | | |
$payload = '${{ toJson(github) }}' | |
$Issuenumber = "${{ github.event.inputs.issue-number }}" | |
$tz = [TimeZoneInfo]::FindSystemTimeZoneById("Asia/Seoul") | |
$today = [DateTimeOffset]::New([TimeZoneInfo]::ConvertTimeBySystemTimeZoneId((Get-Date).ToUniversalTime(), "Asia/Seoul")) | |
$workshop = [DateTimeOffset]::Parse("${{ vars.WORKSHOP_DUE_DATE }}").ToOffset($tz.GetUtcOffset($today)) | |
$result = $(./gha-scripts/Check-IssueDetails.ps1 ` | |
-IssueNumber "${{ github.event.inputs.issue-number }}" ` | |
-DueDate "${{ vars.WORKSHOP_DUE_DATE }}" ` | |
-GitHubPayload $($payload | ConvertFrom-Json)) | ConvertFrom-Json | |
$dateSubmitted = [DateTimeOffset]::Parse($result.dateSubmitted).ToOffset($tz.GetUtcOffset($result.createdAt)).ToString("yyyy-MM-ddTHH:mm:ss.fffzzz") | |
$dateDue = [DateTimeOffset]::Parse($result.dateDue).ToOffset($tz.GetUtcOffset($result.createdAt)).ToString("yyyy-MM-ddTHH:mm:ss.fffzzz") | |
$challengeCode = 'WORKSHOP' | |
echo "issueNumber=$($result.issueNumber)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "issueType=$($result.issueType)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "challengeCode=$challengeCode" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "githubID=$($result.githubID)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "githubProfile=$($result.githubProfile)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "isValidGitHubProfile=$($result.isValidGitHubProfile)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "githubRepository=$($result.githubRepository)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "isValidGitHubRepository=$($result.isValidGitHubRepository)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "frontendUrl=$($result.frontendUrl)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "isValidFrontendUrl=$($result.isValidFrontendUrl)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "backendUrl=$($result.backendUrl)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "isValidBackendUrl=$($result.isValidBackendUrl)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "dashboardUrl=$($result.dashboardUrl)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "isValidDashboardUrl=$($result.isValidDashboardUrl)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "dateSubmitted=$dateSubmitted" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "dateDue=$dateDue" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "isOverdue=$($result.isOverdue)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
# - name: Debug issue details | |
# shell: bash | |
# run: | | |
# echo "Issue number: ${{ steps.issue.outputs.issueNumber }}" | |
# echo "Issue type: ${{ steps.issue.outputs.issueType }}" | |
# echo "Challenge code: ${{ steps.issue.outputs.challengeCode }}" | |
# echo "GitHub ID: ${{ steps.issue.outputs.githubID }}" | |
# echo "GitHub profile: ${{ steps.issue.outputs.githubProfile }}" | |
# echo "Is valid GitHub profile: ${{ steps.issue.outputs.isValidGitHubProfile }}" | |
# echo "GitHub repository: ${{ steps.issue.outputs.githubRepository }}" | |
# echo "Is valid GitHub repository: ${{ steps.issue.outputs.isValidGitHubRepository }}" | |
# echo "Frontend app URL: ${{ steps.issue.outputs.frontendUrl }}" | |
# echo "Is valid frontend app URL: ${{ steps.issue.outputs.isValidFrontendUrl }}" | |
# echo "Backend app URL: ${{ steps.issue.outputs.backendUrl }}" | |
# echo "is valid backend app URL: ${{ steps.issue.outputs.isValidBackendUrl }}" | |
# echo "Dashboard app URL: ${{ steps.issue.outputs.dashboardUrl }}" | |
# echo "Is valid dashboard app URL: ${{ steps.issue.outputs.isValidDashboardUrl }}" | |
# echo "Date submitted: ${{ steps.issue.outputs.dateSubmitted }}" | |
# echo "Date due: ${{ steps.issue.outputs.dateDue }}" | |
# echo "Is overdue: ${{ steps.issue.outputs.isOverdue }}" | |
- name: Add a label - Overdue | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'true' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "overdue" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Overdue | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'true' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
* **이슈 제출 시각** : ${{ steps.issue.outputs.dateSubmitted }} | |
* **이슈 마감 시각** : ${{ steps.issue.outputs.dateDue }} | |
안타깝게도 제출하신 이슈는 **마감 기한인 ${{ steps.issue.outputs.dateDue }}**을 넘겼습니다. 😭 | |
따라서, 이번 "심화교육 - 사전 워크샵" 완주에 반영할 수 없습니다. | |
이번 2024 해커그라운드 해커톤 본선 행사에는 참여하실 수 없지만, 다음 해커그라운드 해커톤에서는 꼭 완주하셔서 본선에서 만나요! 🚀 | |
그동안 해커그라운드 이벤트에 참여해 주셔서 감사합니다. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Close issue - Overdue | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'true' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "과제 제출 기한이 지났습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Add a label - Invalid GitHub profile | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "invalid" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Invalid GitHub profile | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'false' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
안타깝게도 제출하신 **GitHub Profile 주소**를 확인할 수 없습니다. 😱 | |
* 제출 GitHub Profile: `${{ steps.issue.outputs.githubProfile }}` | |
다시 한 번 GitHub Profile 주소를 확인해주세요. | |
이 이슈는 자동으로 닫힐 예정이니, **새롭게 이슈를 생성**해 주세요. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Close issue - Invalid GitHub profile | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "GitHub Profile 주소를 확인할 수 없습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Add a label - Invalid GitHub repository | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "invalid" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Invalid GitHub repository | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'false' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
안타깝게도 제출하신 **GitHub Repository 주소**를 확인할 수 없습니다. 😱 | |
* 제출 GitHub Repository: `${{ steps.issue.outputs.githubRepository }}` | |
다시 한 번 GitHub Repository 주소를 확인해주세요. | |
이 이슈는 자동으로 닫힐 예정이니, **새롭게 이슈를 생성**해 주세요. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Close issue - Invalid GitHub repository | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "GitHub Repository 주소를 확인할 수 없습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Add a label - Invalid frontend app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "invalid" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Invalid frontend app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'false' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
안타깝게도 제출하신 **Frontend App URL 주소**를 확인할 수 없습니다. 😱 | |
* 제출 Frontend App URL: `${{ steps.issue.outputs.frontendUrl }}` | |
다시 한 번 Frontend App URL 주소를 확인해주세요. | |
이 이슈는 자동으로 닫힐 예정이니, **새롭게 이슈를 생성**해 주세요. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Close issue - Invalid frontend app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "Frontend App URL 주소를 확인할 수 없습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Add a label - Invalid backend app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "invalid" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Invalid backend app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'false' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
안타깝게도 제출하신 **Backend App URL 주소**를 확인할 수 없습니다. 😱 | |
* 제출 Backend App URL: `${{ steps.issue.outputs.backendUrl }}` | |
다시 한 번 Backend App URL 주소를 확인해주세요. | |
이 이슈는 자동으로 닫힐 예정이니, **새롭게 이슈를 생성**해 주세요. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Close issue - Invalid backend app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "Backend App URL 주소를 확인할 수 없습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Add a label - Invalid dashboard app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'true' && | |
steps.issue.outputs.isValidDashboardUrl == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "invalid" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Invalid dashboard app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'true' && | |
steps.issue.outputs.isValidDashboardUrl == 'false' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
안타깝게도 제출하신 **Dashboard App URL 주소**를 확인할 수 없습니다. 😱 | |
* 제출 Dashboard App URL: `${{ steps.issue.outputs.backendUrl }}` | |
다시 한 번 Dashboard App URL 주소를 확인해주세요. | |
이 이슈는 자동으로 닫힐 예정이니, **새롭게 이슈를 생성**해 주세요. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Close issue - Invalid dashboard app URL | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'true' && | |
steps.issue.outputs.isValidDashboardUrl == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "Dashboard App URL 주소를 확인할 수 없습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Call Power Automate workflow to verify GitHub ID from the registration details | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'true' && | |
steps.issue.outputs.isValidDashboardUrl == 'true' | |
id: registration-verification | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: ${{ secrets.PAU_ON_REGISTRATION_VERIFICATION_REQUESTED_URL_HOL }} | |
method: "POST" | |
data: '{ "issueType": "${{ steps.issue.outputs.issueType }}", "githubProfile": "${{ steps.issue.outputs.githubProfile }}" }' | |
- name: Check registration details | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.issue.outputs.isValidGitHubProfile == 'true' && | |
steps.issue.outputs.isValidGitHubRepository == 'true' && | |
steps.issue.outputs.isValidFrontendUrl == 'true' && | |
steps.issue.outputs.isValidBackendUrl == 'true' && | |
steps.issue.outputs.isValidDashboardUrl == 'true' | |
id: registration-verification-result | |
shell: pwsh | |
run: | | |
$result = '${{ steps.registration-verification.outputs.response }}' | ConvertFrom-Json | |
echo "isValidRegistration=$($result.isValidRegistration)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
- name: Add a label - Invalid registration details | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "invalid" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Invalid registration details | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'false' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
안타깝게도 제출하신 정보로 신청한 참가자를 찾을 수 없습니다. 😱 | |
* 제출 GitHub Profile: `${{ steps.issue.outputs.githubProfile }}` | |
해커톤 등록 정보를 확인하신 후, **새롭게 이슈를 생성**해 주세요. | |
다시 이슈를 생성했는데도 같은 문제가 발생한다면, 디스코드 채널 `#사전워크샵`에 문의해주세요. | |
이후, 이 이슈는 자동으로 닫힐 예정입니다. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Close issue - Invalid registration details | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'false' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "등록 정보를 확인할 수 없습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Add a label - Acknowledge | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "workshop,verifying" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - Acknowledge | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
emoji: "+1,rocket" | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
사전 워크샵 과제 완료 이슈를 생성해 주셔서 감사합니다! 🎉 | |
생성해주신 이슈는 현재 확인 중이며, 완주 여부를 확인한 후 다시 알려드리겠습니다. | |
참가자님의 해커톤 완주를 응원해요! 💪🏼 | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Check workshop challenge | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' | |
id: check-workshop-challenge | |
shell: pwsh | |
run: | | |
$errorCode = "${{ github.event.inputs.error-code }}" | |
$forceError = if ($errorCode -eq '') { $false } else { $true } | |
$challengeCode = "${{ steps.issue.outputs.challengeCode }}" | |
pushd ./check-workshop-challenge | |
dotnet restore && dotnet build | |
$playwright = Get-ChildItem -File Microsoft.Playwright.dll -Path . -Recurse | |
$installer = "$($playwright[0].Directory.FullName)/playwright.ps1" | |
& "$installer" install | |
if ($forceError -eq $true) { | |
$result = dotnet run ` | |
--project ./src/HackersGround.Workshop.Challenge.ConsoleApp ` | |
-- ` | |
-c $challengeCode ` | |
-f ${{ steps.issue.outputs.frontendUrl }} ` | |
-b ${{ steps.issue.outputs.backendUrl }} ` | |
-d ${{ steps.issue.outputs.dashboardUrl }} ` | |
--force-error ` | |
--error-code $errorCode | |
$result= $result[$result.IndexOf("{")..$($result.Length-1)] | ConvertFrom-Json | |
} else { | |
$result = dotnet run ` | |
--project ./src/HackersGround.Workshop.Challenge.ConsoleApp ` | |
-- ` | |
-c $challengeCode ` | |
-f ${{ steps.issue.outputs.frontendUrl }} ` | |
-b ${{ steps.issue.outputs.backendUrl }} ` | |
-d ${{ steps.issue.outputs.dashboardUrl }} | |
$result= $result[$result.IndexOf("{")..$($result.Length-1)] | ConvertFrom-Json | |
} | |
echo "result=$result" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "challengeCode=$($result.challengeCode)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "challengeStatus=$($result.challengeStatus)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "challengeMessage=$($result.message)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
popd | |
- name: Add label - FAILED | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'FAILED' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "failed" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - FAILED | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'FAILED' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
저희 쪽에서 확인하는 중에 문제가 발생했습니다❗ | |
최대한 빨리 확인한 후 다시 알려드리겠습니다. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Add label - INVALID | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'INVALID' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "invalid" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - INVALID | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'INVALID' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
입력하신 값이 올바르지 않습니다. 😭 | |
다시 한 번 확인해 주세요❗ | |
이 이슈는 자동으로 닫힐 예정이니, **새롭게 이슈를 생성**해 주세요. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Remove label - INVALID | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'INVALID' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--remove-label "verifying" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Close issue - INVALID | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'INVALID' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "입력 값이 올바르지 않습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Add label - NOT_COMPLETED | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'NOT_COMPLETED' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--add-label "incomplete" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Comment to issue - NOT_COMPLETED | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'NOT_COMPLETED' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "create-comment" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
body: | | |
👋🏼 @${{ steps.issue.outputs.githubId }} 님! | |
확인 결과 과제를 아직 끝마치지 않으셨습니다. 😭 | |
과제를 완료 하신 후 이슈를 생성해주세요❗ | |
이 이슈는 자동으로 닫힐 예정이니, **새롭게 이슈를 생성**해 주세요. | |
🔹 해커그라운드 운영진 일동 🔹 | |
- name: Remove label - NOT_COMPLETED | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'NOT_COMPLETED' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue edit ${{ steps.issue.outputs.issueNumber }} \ | |
--remove-label "verifying" \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Close issue - NOT_COMPLETED | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
steps.check-workshop-challenge.outputs.challengeStatus == 'NOT_COMPLETED' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh issue close ${{ steps.issue.outputs.issueNumber }} \ | |
-c "과제 완료 기록을 확인할 수 없습니다. 이슈를 닫습니다." \ | |
-R ${{ github.event.repository.full_name }} | |
- name: Get random inspector | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
(steps.check-workshop-challenge.outputs.challengeStatus == 'FAILED' || steps.check-workshop-challenge.outputs.challengeStatus == 'COMPLETED') | |
id: inspector | |
shell: pwsh | |
run: | | |
$inspector = ./get-randomassignee/Get-RandomAssignee.ps1 -Assignees "${{ vars.INSPECTORS }}" | |
echo "githubId=$inspector" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
- name: Assign an inspector | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' && | |
steps.issue.outputs.isOverdue == 'false' && | |
steps.registration-verification-result.outputs.isValidRegistration == 'true' && | |
(steps.check-workshop-challenge.outputs.challengeStatus == 'FAILED' || steps.check-workshop-challenge.outputs.challengeStatus == 'COMPLETED') | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: "add-assignees" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ steps.issue.outputs.issueNumber }} | |
assignees: ${{ steps.inspector.outputs.githubId }} | |
- name: Set challenge status | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' | |
id: challenge-status | |
shell: pwsh | |
run: | | |
$result = if ("${{ steps.issue.outputs.isOverdue }}" -eq "true") { | |
'OVERDUE' | |
} elseif ("${{ steps.issue.outputs.isValidGitHubProfile }}" -eq "false") { | |
'INVALID_GITHUB_PROFILE' | |
} elseif ("${{ steps.issue.outputs.isValidGitHubRepository }}" -eq "false") { | |
'INVALID_GITHUB_REPOSITORY' | |
} elseif ("${{ steps.issue.outputs.isValidFrontendUrl }}" -eq "false") { | |
'INVALID_FRONTEND_URL' | |
} elseif ("${{ steps.issue.outputs.isValidBackendUrl }}" -eq "false") { | |
'INVALID_BACKEND_URL' | |
} elseif ("${{ steps.issue.outputs.isValidDashboardUrl }}" -eq "false") { | |
'INVALID_DASHBOARD_URL' | |
} elseif ("${{ steps.registration-verification-result.outputs.isValidRegistration }}" -eq "false") { | |
'REGISTRATION_NOT_FOUND' | |
} elseif ("${{ steps.check-workshop-challenge.outputs.challengeStatus }}" -eq "INVALID") { | |
'INVALID_INPUT' | |
} elseif ("${{ steps.check-workshop-challenge.outputs.challengeStatus }}" -eq "NOT_COMPLETED") { | |
'NOT_COMPLETED' | |
} elseif ("${{ steps.check-workshop-challenge.outputs.challengeStatus }}" -eq "COMPLETED") { | |
'COMPLETED' | |
} else { | |
'SOMETHING_WENT_WRONG' | |
} | |
echo "value=$result" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
- name: Call Power Automate workflow | |
if: | | |
steps.issue.outputs.issueType == 'WORKSHOP' | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: ${{ secrets.PAU_ON_WORKSHOP_SUBMITTED_URL }} | |
method: "POST" | |
data: '{ "githubId": "${{ steps.issue.outputs.githubID }}", "challengeStatus": "${{ steps.challenge-status.outputs.value }}", "dateDue": "${{ steps.issue.outputs.dateDue }}", "dateSubmitted": "${{ steps.issue.outputs.dateSubmitted }}", "githubProfileUrl": "${{ steps.issue.outputs.githubProfile }}", "frontendUrl": "${{ steps.issue.outputs.frontendUrl }}", "backendUrl": "${{ steps.issue.outputs.backendUrl }}", "dashboardUrl": "${{ steps.issue.outputs.dashboardUrl }}", "githubRepository": "${{ steps.issue.outputs.githubRepository }}" }' |