Skip to content

Commit

Permalink
fix: avoid showing "template is not valid" error (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi authored May 26, 2022
1 parent 79ceb81 commit e209131
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ runs:
echo "::endgroup::"
shell: bash
env:
INPUTS_TOOLCHAIN: ${{ fromJson(steps.prepare.outputs.build).toolchain }}
INPUTS_TOOLCHAIN: ${{ steps.prepare.outputs.build && fromJson(steps.prepare.outputs.build).toolchain }}

- name: Generate Static HTML
id: build
Expand All @@ -90,27 +90,27 @@ runs:
echo "::endgroup::"
shell: bash
env:
INPUTS_BUILD: ${{ toJSON(fromJson(steps.prepare.outputs.build)) }}
INPUTS_BUILD: ${{ steps.prepare.outputs.build && toJSON(fromJson(steps.prepare.outputs.build)) }}

- name: Upload Build Artifacts
id: upload-build-artifacts
uses: actions/upload-artifact@v2
with:
path: |-
${{ fromJson(steps.build.outputs.gh).dest }}
${{ fromJson(steps.build.outputs.w3c).dest }}
${{ steps.build.outputs.gh && fromJson(steps.build.outputs.gh).dest }}
${{ steps.build.outputs.w3c && fromJson(steps.build.outputs.w3c).dest }}
name: spec-prod-result
retention-days: 5

- name: Validate hyperlinks
if: ${{ fromJson(steps.prepare.outputs.validate).links }}
if: ${{ success() && steps.prepare.outputs.validate && fromJson(steps.prepare.outputs.validate).links }}
run: |
echo "::group::Validate hyperlinks"
node --enable-source-maps ${{ github.action_path }}/src/validate-links.js
echo "::endgroup::"
shell: bash
env:
OUTPUTS_BUILD: ${{ toJson(fromJson(steps.build.outputs.w3c)) }}
OUTPUTS_BUILD: ${{ steps.build.outputs.w3c && toJson(fromJson(steps.build.outputs.w3c)) }}

- name: Validate markup
run: |
Expand All @@ -119,8 +119,8 @@ runs:
echo "::endgroup::"
shell: bash
env:
INPUTS_VALIDATE_MARKUP: ${{ fromJson(steps.prepare.outputs.validate).markup }}
OUTPUTS_BUILD: ${{ toJson(fromJson(steps.build.outputs.w3c)) }}
INPUTS_VALIDATE_MARKUP: ${{ steps.prepare.outputs.validate && fromJson(steps.prepare.outputs.validate).markup }}
OUTPUTS_BUILD: ${{ steps.build.outputs.w3c && toJson(fromJson(steps.build.outputs.w3c)) }}

- name: Validate pubrules (Specberus)
run: |
Expand All @@ -129,8 +129,8 @@ runs:
echo "::endgroup::"
shell: bash
env:
INPUTS_VALIDATE_PUBRULES: ${{ fromJson(steps.prepare.outputs.validate).pubrules }}
OUTPUTS_BUILD: ${{ toJson(fromJson(steps.build.outputs.w3c)) }}
INPUTS_VALIDATE_PUBRULES: ${{ steps.prepare.outputs.validate && fromJson(steps.prepare.outputs.validate).pubrules }}
OUTPUTS_BUILD: ${{ steps.build.outputs.w3c && toJson(fromJson(steps.build.outputs.w3c)) }}
INPUTS_W3C_API_KEY: ${{ inputs.W3C_API_KEY }}

- name: Validate Web IDL
Expand All @@ -140,8 +140,8 @@ runs:
echo "::endgroup::"
shell: bash
env:
INPUTS_VALIDATE_WEBIDL: ${{ fromJson(steps.prepare.outputs.validate).webidl }}
OUTPUTS_BUILD: ${{ toJson(fromJson(steps.build.outputs.w3c)) }}
INPUTS_VALIDATE_WEBIDL: ${{ steps.prepare.outputs.validate && fromJson(steps.prepare.outputs.validate).webidl }}
OUTPUTS_BUILD: ${{ steps.build.outputs.w3c && toJson(fromJson(steps.build.outputs.w3c)) }}

- name: Deploy to GitHub pages
run: |
Expand All @@ -150,8 +150,8 @@ runs:
echo "::endgroup::"
shell: bash
env:
INPUTS_DEPLOY: ${{ toJson(fromJson(steps.prepare.outputs.deploy).ghPages) }}
OUTPUT_DIR: ${{ fromJson(steps.build.outputs.gh).root }}
INPUTS_DEPLOY: ${{ steps.prepare.outputs.deploy && toJson(fromJson(steps.prepare.outputs.deploy).ghPages) }}
OUTPUT_DIR: ${{ steps.build.outputs.gh && fromJson(steps.build.outputs.gh).root }}

- name: Deploy to W3C
run: |
Expand All @@ -160,5 +160,13 @@ runs:
echo "::endgroup::"
shell: bash
env:
INPUTS_DEPLOY: ${{ toJson(fromJson(steps.prepare.outputs.deploy).w3c) }}
OUTPUTS_BUILD: ${{ toJson(fromJson(steps.build.outputs.w3c)) }}
INPUTS_DEPLOY: ${{ steps.prepare.outputs.deploy && toJson(fromJson(steps.prepare.outputs.deploy).w3c) }}
OUTPUTS_BUILD: ${{ steps.build.outputs.w3c && toJson(fromJson(steps.build.outputs.w3c)) }}

- name: End
if: ${{ failure() }}
shell: bash
run: |
# Failed
node -e 'require("@actions/core").setFailed("Failed. See details above.")'
working-directory: ${{ github.action_path }}

0 comments on commit e209131

Please sign in to comment.