Skip to content

Add RAWGraphs by @johannawild #61

Add RAWGraphs by @johannawild

Add RAWGraphs by @johannawild #61

Workflow file for this run

name: Add Tool
run-name: Add ${{ inputs.toolName }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
toolName:
description: 'Tool Name'
type: string
required: true
email:
description: 'Team Member Email (optional)'
type: string
jobs:
add-tool:
runs-on: ubuntu-latest
env:
TOOL_NAME: ${{ inputs.toolName }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Mask secrets
run: |
INPUT_EMAIL==$(jq -r '.inputs.email' $GITHUB_EVENT_PATH)
echo ::add-mask::$INPUT_EMAIL
echo EMAIL=$INPUT_EMAIL >> $GITHUB_ENV
- name: Create Gitbook Space and Team (look here for the link!)
id: add-space
env:
GITBOOK_API_TOKEN: ${{ secrets.GITBOOK_API_TOKEN }}
run: |
node add-space.mjs "$TOOL_NAME" "$EMAIL"
- name: Create new tool folder (look here for git sync config!)
id: add-folder
run: |
node add-tool.mjs "$TOOL_NAME"
if [ -n "$(git status --porcelain)" ]; then
echo "changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit changes ${{ steps.add-folder.outputs.changes }}
if: ${{ steps.add-folder.outputs.changes == 'true' }}
run: |
git status --porcelain
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add $TOOL_NAME"
- name: Push changes
if: ${{ steps.add-folder.outputs.changes == 'true' }}
uses: ad-m/github-push-action@master
with:
branch: main