Add a Greyhound #46
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: Add a Greyhound | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
type: string | |
required: true | |
summary: | |
description: Short summary about this greyhound | |
type: string | |
default: '' | |
color: | |
type: string | |
required: true | |
sex: | |
type: choice | |
options: | |
- male | |
- female | |
required: true | |
dob: | |
description: Date of birth, format MM/DD/YYYY | |
type: string | |
required: true | |
concurrency: | |
group: ${{ github.workflow }} | |
env: | |
INPUTS: ${{ toJSON(inputs) }} | |
jobs: | |
Add: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ROOBOT_PAT }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
- run: npm ci | |
- id: add | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const inputs = JSON.parse(process.env.INPUTS) | |
const addGreyhound = require('./script/add-greyhound.js') | |
const message = await addGreyhound({github, context, core, inputs}) | |
core.setOutput('message', message) | |
- id: push | |
run: | | |
git config --global user.email 'website@galtx-centex.org' | |
git config --global user.name 'Roobot' | |
git add _greyhounds/ | |
git commit -m '${{ steps.add.outputs.message }}' | |
git push origin ${{ github.ref_name }} | |