Skip to content

Commit

Permalink
Merge pull request #115 from puja-trivedi/add_input_to_wf
Browse files Browse the repository at this point in the history
Add input to wf
  • Loading branch information
puja-trivedi authored Dec 9, 2024
2 parents 67da881 + 27ae7aa commit 192eb2e
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/generate_yaml_model.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Generates linkml yaml schema from metadata in googlesheets using schemasheets
name: generating yaml file

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
model:
description: 'model name'
required: true
type: string

jobs:
generate_libgen_yaml:
Expand All @@ -26,11 +32,27 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential git wget curl
# Check if download-dir exists; if not, create it
- name: Check if download-dir exists
run: |
if [ ! -d "linkml-schema/source_${{ inputs.model }}/gsheet_output" ]; then
echo "Directory does not exist. Making directory"
mkdir -p linkml-schema/source_${{ inputs.model }}/gsheet_output
fi
# Check if gsheet.yaml exists
- name: Check if gsheet.yaml exists
run: |
if [ ! -f "linkml-schema/source_${{ inputs.model }}/gsheet.yaml" ]; then
echo "gsheet.yaml does not exist. Exiting"
exit 1
fi
# Generate yaml model
- name: Generate yaml model
run: |
cd linkml-schema
bkbit schema2model -o library_generation.yaml --gsheet --gsheet-download-dir source_library_generation/gsheet_output source_library_generation/gsheet.yaml --no-inlined
bkbit schema2model -o ${{ inputs.model }}.yaml --gsheet --gsheet-download-dir source_${{ inputs.model }}/gsheet_output source_${{ inputs.model }}/gsheet.yaml --no-inlined
cd ..
# Generate unique branch name
Expand All @@ -45,8 +67,8 @@ jobs:
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
commit-message: "Generate new version of the linkml model"
commit-message: "Generate new version of the linkml model for ${{ inputs.model }}"
branch: ${{ env.BRANCH_NAME }}
title: "Auto PR: yaml generated from google spreadsheets using schemasheets"
body: "This PR adds a autogenerated yaml file."
title: "Auto PR: ${{ inputs.model }}.yaml generated from google spreadsheets using schemasheets"
body: "This PR adds a autogenerated ${{ inputs.model }}.yaml file."
base: main

0 comments on commit 192eb2e

Please sign in to comment.