Report Match #87
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: Report Match | |
on: | |
workflow_dispatch: | |
inputs: | |
winner_name: | |
description: 'Winner' | |
required: true | |
type: choice | |
options: | |
- 'Brian' | |
- 'Chris' | |
- 'Graham' | |
- 'James Michael Haley' | |
- 'Jay' | |
- 'John' | |
- 'Reinhold (Modi) Lauer' | |
- 'Somchai' | |
- 'Van' | |
- 'Vinod (Vinnie) Ratnaphat' | |
- 'Walter (Mief) Meuwis' | |
loser_name: | |
description: 'Loser' | |
required: true | |
type: choice | |
options: | |
- 'Brian' | |
- 'Chris' | |
- 'Graham' | |
- 'James Michael Haley' | |
- 'Jay' | |
- 'John' | |
- 'Reinhold (Modi) Lauer' | |
- 'Somchai' | |
- 'Van' | |
- 'Vinod (Vinnie) Ratnaphat' | |
- 'Walter (Mief) Meuwis' | |
match_length: | |
description: 'Length' | |
default: '5' | |
required: true | |
type: choice | |
options: | |
- '1' | |
- '3' | |
- '5' | |
- '7' | |
- '9' | |
- '11' | |
- '13' | |
- '15' | |
- '17' | |
- '19' | |
- '21' | |
- '23' | |
- '25' | |
jobs: | |
process_action_match: | |
runs-on: windows-latest | |
steps: | |
- name: Check Out Repository | |
uses: actions/checkout@v4 | |
- name: Get Match Info | |
id: get_match | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const date = new Date(); | |
const formattedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`; | |
const inputs = context.payload.inputs | |
var winner = inputs.winner_name; | |
var loser = inputs.loser_name; | |
const match_length = inputs.match_length; | |
console.log(`Match Date: ${formattedDate}`); | |
return `|${ formattedDate }|${ winner }|${ loser }|${ match_length }|`; | |
- name: Append Match Info to Match List | |
run: | | |
echo ${{ steps.get_match.outputs.result }} >> "Match List.md" | |
- name: Update Rating List | |
run: | | |
echo "Updateing Rating List with " ${{ steps.get_match.outputs.result }} | |
./bigeloCLI.exe | |
echo "Updated Rating List!" | |
- name: Commit Changes | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add 'Match List.md' | |
git add 'README.md' | |
git commit -m '${{ steps.get_match.outputs.result }} -> Rating' | |
git push |