Skip to content

Commit

Permalink
Update GHA workflow & templates
Browse files Browse the repository at this point in the history
  • Loading branch information
justinyoo committed Aug 23, 2024
1 parent 2cc41c7 commit a8784cc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/on-hackathon-r2-verified.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
description: 'Issue number'
required: true
default: ''
inspected:
description: 'Value indicating whether the verification process done by human or not'
required: true
default: 'false'
verified:
description: 'Value indicating whether the verification process is successful or not'
required: true
Expand Down Expand Up @@ -62,9 +66,11 @@ jobs:
-GitHubPayload $($payload | ConvertFrom-Json)) | ConvertFrom-Json
if ("${{ github.event_name}}" -eq "workflow_dispatch") {
$inspected = "${{ github.event.inputs.inspected }}"
$verified = ("${{ github.event.inputs.verified }}".ToLowerInvariant() -eq "true") ? "true" : "false"
$invalid = ""
} else {
$inspected = "true"
$verified = ("${{ github.event.comment.body }}".StartsWith("/ok")) ? "true" : "false"
$invalid = ("${{ github.event.comment.body }}".StartsWith("/invalid")) ? "true" : ""
}
Expand All @@ -76,6 +82,7 @@ jobs:
echo "title=$($result.title)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "teamName=$($result.teamName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "teamRepository=$($result.teamRepository)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "inspected=$inspected" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "verified=$verified" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
echo "invalid=$invalid" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
Expand Down Expand Up @@ -124,7 +131,7 @@ jobs:
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
steps.issue.outputs.verified == 'true' &&
github.event_name != 'workflow_dispatch'
steps.issue.outputs.inspected == 'true'
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -138,7 +145,7 @@ jobs:
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
steps.issue.outputs.verified == 'true' &&
github.event_name != 'workflow_dispatch'
steps.issue.outputs.inspected == 'true'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
Expand All @@ -158,11 +165,22 @@ jobs:
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
steps.issue.outputs.verified == 'true' &&
github.event_name != 'workflow_dispatch'
steps.issue.outputs.inspected == '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: Call Power Automate workflow
if: |
steps.issue.outputs.issueType == 'TOPIC' &&
steps.issue.outputs.inspected == 'true'
id: request
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.PAU_ON_ROUND_2_VERIFIED_URL }}
method: 'POST'
data: '{ "issueNumber": ${{ steps.issue.outputs.issueNumber }}, "githubId": "${{ steps.issue.outputs.githubID }}", "teamName": "${{ steps.issue.outputs.teamName }}", "repositoryName": "${{ steps.issue.outputs.teamRepository }}", "verified": "${{ steps.issue.outputs.verified }}", "invalid": "${{ steps.issue.outputs.invalid }}" }'
11 changes: 8 additions & 3 deletions templates/hackathon/teamTopic.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
다시 한 번 주제 제출을 완료해주세요. 주제 제출을 완료하지 않으면, 팀 전체에게 불이익이 있습니다.

------

아직 "{{ TEAM_NAME }}"팀의 주제 제출절차가 끝나지 않았습니다. 주제 제출을 완료하지 못한 경우는 다음과 같습니다.

- 제출한 GitHub ID가 팀장 ID와 일치하지 않습니다.
Expand All @@ -27,6 +26,12 @@
마감 기한을 초과하여 페널티를 받게 됩니다.

------
"{{ TEAM_NAME }}"팀 주제 제출을 완료했습니다.
"{{ TEAM_NAME }}"팀 주제 제출을 완료했습니다. 이슈 검증단의 최종 확인 후 결과를 알려드리겠습니다.

제출 완료 시각은 "{{ DATE_SUBMITTED }}" 입니다.

제출 완료 시각은 "{{ DATE_SUBMITTED }}" 입니다.
------
"{{ TEAM_NAME }}"팀 주제 제출 관련, 이슈 검증단의 최종 확인 결과 정상입니다. 계속 진행해주세요.

------
"{{ TEAM_NAME }}"팀 주제 제출 관련, 이슈 검증단의 최종 확인 결과 문제가 생겼습니다. 즉시 사무국에 문의해주세요.
11 changes: 8 additions & 3 deletions templates/hackathon/teamTopic.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
안녕하세요, "{{ NAMES }}"님.

------

아직 "{{ TEAM_NAME }}"팀의 주제 제출절차가 끝나지 않았습니다. 주제 제출을 완료하지 못한 경우는 아래의 둘 중 한가지입니다.

- 팀 빌딩 시 제출한 팀 이름과 일치하지 않습니다.
Expand All @@ -26,6 +25,12 @@
마감 기한을 초과하여 페널티를 받게 됩니다.

------
"{{ TEAM_NAME }}"팀 주제 제출을 완료했습니다.
"{{ TEAM_NAME }}"팀 주제 제출을 완료했습니다. 이슈 검증단의 최종 확인 후 결과를 알려드리겠습니다.

제출 완료 시각은 "{{ DATE_SUBMITTED }}" 입니다.

제출 완료 시각은 "{{ DATE_SUBMITTED }}" 입니다.
------
"{{ TEAM_NAME }}"팀 주제 제출 관련, 이슈 검증단의 최종 확인 결과 정상입니다. 계속 진행해주세요.

------
"{{ TEAM_NAME }}"팀 주제 제출 관련, 이슈 검증단의 최종 확인 결과 문제가 생겼습니다. 즉시 사무국에 문의해주세요.

0 comments on commit a8784cc

Please sign in to comment.