diff --git a/.github/workflows/error.yml b/.github/workflows/error.yml new file mode 100644 index 0000000..938f98e --- /dev/null +++ b/.github/workflows/error.yml @@ -0,0 +1,27 @@ +name: "Error" + +on: + ["push", "workflow_dispatch"] + +jobs: + asd: + runs-on: ubuntu-latest + name: ASD documents + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Error profile + id: asd + uses: ./ # Uses an action in the root directory + with: + profile: tests/profile/error.xml + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ${{ steps.asd.outputs.dir}} + destination_dir: ${{ steps.asd.outputs.dir}} + diff --git a/entrypoint.sh b/entrypoint.sh index 0d6d936..57cc4fb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,5 +3,10 @@ composer require koriym/app-state-diagram dirname=$(dirname $2) ./vendor/bin/asd --config=$1 $2 -echo "Output Directory: $dirname" -echo "::set-output name=dir::$dirname" +if [ $? -ne "0" ]; then + echo "ASD error" + exit 1 +else + echo "Output Directory: $dirname" + echo "::set-output name=dir::$dirname" +fi diff --git a/tests/profile/error.xml b/tests/profile/error.xml new file mode 100644 index 0000000..49d7206 --- /dev/null +++ b/tests/profile/error.xml @@ -0,0 +1,11 @@ + + + Error + + + + + +