Add output to build.yaml

This commit is contained in:
Ben C 2022-07-11 14:06:06 -04:00 committed by GitHub
parent 581efa14cb
commit 472ec35dd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 7 deletions

View File

@ -17,11 +17,18 @@ on:
required: false
default: "Debug"
type: string
outputs:
schemas_changed:
description: 'Have the schemas been updated?'
value: ${{ jobs.Build.outputs.schemas_changed }}
jobs:
Build:
runs-on: windows-latest
outputs:
schemas_changed: ${{ steps.changed_files.outputs.files_changed }}
steps:
- name: Checkout Repo
@ -58,3 +65,9 @@ jobs:
name: NewHorizons-Schemas-${{ inputs.build_type }}
path: .\NewHorizons\Schemas
- name: Verify Changed Schemas
uses: tj-actions/verify-changed-files@v9.1
id: changed_files
with:
files: NewHorizons/Schemas/**

View File

@ -19,6 +19,7 @@ jobs:
Update_Schemas:
name: 'Update Schemas'
needs: Build
if: ${{ needs.Build.outputs.schemas_changed }}
uses: './.github/workflows/update_schemas.yml'
with:
artifact_name: NewHorizons-Schemas-Debug

View File

@ -28,6 +28,7 @@ jobs:
Update_Schemas:
name: 'Update Schemas'
needs: Build
if: ${{ needs.Build.outputs.schemas_changed && github.ref != 'refs/heads/dev' }} # Debug build will update schemas on dev, so don't run if we're on dev
uses: ./.github/workflows/update_schemas.yml
with:
artifact_name: NewHorizons-Schemas-Release

View File

@ -21,12 +21,6 @@ jobs:
name: ${{ inputs.artifact_name }}
path: NewHorizons/Schemas/
- name: Verify Changed Schemas
uses: tj-actions/verify-changed-files@v9.1
id: changed_files
with:
files: NewHorizons/Schemas/**
- name: Commit Schemas
if: steps.changed_files.outputs.files_changed == 'true'
run: |
@ -36,7 +30,6 @@ jobs:
git commit -m "Updated Schemas"
- name: Push Schemas
if: ${{ (steps.changed_files.outputs.files_changed == 'true') && (github.event_name != 'pull_request') }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.github_token }}