refactor(ci): use custom action for checking codegen status (#5493)

This commit is contained in:
Harshal Sheth 2022-07-27 01:04:57 +00:00 committed by GitHub
parent 85a55ffac7
commit 44122d4e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 18 deletions

View File

@ -0,0 +1,16 @@
name: 'Ensure codegen is updated'
description: 'Will check the local filesystem against git, and abort if there are uncommitted changes.'
runs:
using: "composite"
steps:
- shell: bash
run: |
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
# See https://unix.stackexchange.com/a/155077/378179.
echo 'There are uncommitted changes:'
echo $output
exit 1
else
echo 'All good!'
fi

View File

@ -48,15 +48,7 @@ jobs:
**/build/test-results/test/** **/build/test-results/test/**
**/junit.*.xml **/junit.*.xml
- name: Ensure codegen is updated - name: Ensure codegen is updated
run: | uses: ./.github/actions/ensure-codegen-updated
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
# See https://unix.stackexchange.com/a/155077/378179.
echo 'There are uncommitted changes:'
echo $output
exit 1
else
echo 'All good!'
fi
- name: Slack failure notification - name: Slack failure notification
if: failure() && github.event_name == 'push' if: failure() && github.event_name == 'push'
uses: kpritam/slack-job-status-action@v1 uses: kpritam/slack-job-status-action@v1

View File

@ -51,15 +51,7 @@ jobs:
**/build/test-results/test/** **/build/test-results/test/**
**/junit.*.xml **/junit.*.xml
- name: Ensure codegen is updated - name: Ensure codegen is updated
run: | uses: ./.github/actions/ensure-codegen-updated
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
# See https://unix.stackexchange.com/a/155077/378179.
echo 'There are uncommitted changes:'
echo $output
exit 1
else
echo 'All good!'
fi
event-file: event-file:
runs-on: ubuntu-latest runs-on: ubuntu-latest