Skip to content

Commit 5895b8c

Browse files
guydavenportGuy Davenport
andauthored
655 only commit generated files when branch name matches a release (#656)
* updated CI action * corrected EnvironmentParameters to EnvironmentParameter * corrected if statement * corrected if statement * corrected if statement --------- Co-authored-by: Guy Davenport <guy.davenport@partners.basf.com>
1 parent 00e2372 commit 5895b8c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/generate-schema.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,19 @@ jobs:
2222
run: |
2323
echo "Automated commit detected - skipping job"
2424
echo "skip_job=true" >> "$GITHUB_OUTPUT"
25-
25+
- name: Check Branch with Regex
26+
id: check-tag
27+
run: |
28+
if [ "${{ github.ref }}" =~ ^refs/heads/brapi-V[0-9]+\.[0-9]+$ ]; then
29+
echo "commit=true" >> $GITHUB_ENV
30+
else
31+
echo "commit=false" >> $GITHUB_ENV
32+
fi
33+
if [[env.commit == 'true']]; then
34+
echo "Release branch - will commit generated files"
35+
else
36+
echo "Feature branch - will NOT commit generated files"
37+
fi
2638
generate:
2739
runs-on: ubuntu-latest
2840
needs: check
@@ -63,4 +75,5 @@ jobs:
6375
- name: Compare OpenAPI
6476
working-directory: ./generator
6577
run: ./gradlew compareAll
66-
- uses: stefanzweifel/git-auto-commit-action@v5
78+
- if: env.commit == 'true'
79+
uses: stefanzweifel/git-auto-commit-action@v5

Specification/BrAPI-Schema/BrAPI-Core/Study.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
"parameterName",
383383
"description"
384384
],
385-
"title": "EnvironmentParameters",
385+
"title": "EnvironmentParameter",
386386
"description": "Environmental parameters that were kept constant throughout the study and did not change between observation units. \n\nMIAPPE V1.1 (DM-57) Environment - Environmental parameters that were kept constant throughout the study and did not change between observation units or assays. Environment characteristics that vary over time, i.e. environmental variables, should be recorded as Observed Variables (see below).",
387387
"type": "object",
388388
"brapi-metadata": {

0 commit comments

Comments
 (0)