Report Match #242
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: | |
- 'Anders' | |
- 'Ashok' | |
- 'Benny' | |
- 'Brian' | |
- 'Chris' | |
- 'Chuck' | |
- 'David' | |
- 'Disney' | |
- 'Graham' | |
- 'Gregg' | |
- 'James' | |
- 'Jay' | |
- 'John' | |
- 'Modi' | |
- 'Pradyot' | |
- 'Somchai' | |
- 'Van' | |
- 'Vinnie' | |
- 'Walter' | |
loser_name: | |
description: 'Loser' | |
required: true | |
type: choice | |
options: | |
- 'Anders' | |
- 'Ashok' | |
- 'Benny' | |
- 'Brian' | |
- 'Chris' | |
- 'Chuck' | |
- 'David' | |
- 'Disney' | |
- 'Graham' | |
- 'Gregg' | |
- 'James' | |
- 'Jay' | |
- 'John' | |
- 'Modi' | |
- 'Pradyot' | |
- 'Somchai' | |
- 'Van' | |
- 'Vinnie' | |
- 'Walter' | |
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: ubuntu-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(`____________________________`); | |
console.log(`${ formattedDate } ${ winner } > ${ loser } ${ match_length }`); | |
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 "____________________________" | |
echo ${{ steps.get_match.outputs.result }} | |
chmod +x ./bigeloLin | |
./bigeloLin | |
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 }}' | |
git push |