Skip to content

Commit

Permalink
Boolean handling workaround for workflow_call vs workflow_dispatch bug.
Browse files Browse the repository at this point in the history
This fix will resolve the issue noticed in the runs post release prep.

https://github.com/usnistgov/OSCAL/runs/6311164174
https://github.com/usnistgov/OSCAL/runs/6311163976

This is a workaround report in this thread.

community/community#9343 (comment)

It pertains to this issue, which has yet to be fixed in GitHub Actions
runners that exhibit a difference in behavior for the same boolean input
being treated as a string in a `workflow_dispatch` `inputs`
(i.e. `github.event.inputs.*`) even if `type: boolean` is set but
behaves properly as intended for `workflow_call` `inputs`
(`inputs.*` which are different in the object graph) and treated as bools
through and through. This is reported in actions/runner#1483.

To resolve this, the buggy `workflow_dispatch` `github.event.inputs.*`
will be left with the workaround as-is, conditional checking the values
as strings, but we revert the changes for `workflow_call` `inputs.*` and
leave them like before until actions/runner#1483 is resolved.
  • Loading branch information
aj-stein-nist committed May 6, 2022
1 parent f362159 commit 140f482
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/workflow-generate-metaschema-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
id: checkout_latest_workflow
# use this for builds triggered from other workflows on protected branches
- name: Checkout Latest (using access_token)
if: github.event_name == 'push' && inputs.commit_resources == 'true'
if: github.event_name == 'push' && inputs.commit_resources == true
uses: actions/checkout@v3
with:
path: ${{ env.CHECKOUT_PATH }}
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
# ---------------
- name: Publish Schemas and Converters
# only do this on master
if: github.event.inputs.commit_resources == 'true' || inputs.commit_resources == 'true'
if: github.event.inputs.commit_resources == 'true' || inputs.commit_resources == true
uses: stefanzweifel/[email protected]
with:
repository: ${{ env.CHECKOUT_PATH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow-generate-website-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
id: checkout_main_workflow
# use this for builds triggered from other workflows on protected branches
- name: Checkout Main (using access_token)
if: github.event_name == 'push' && inputs.commit_resources == 'true'
if: github.event_name == 'push' && inputs.commit_resources == true
uses: actions/checkout@v3
with:
path: ${{ env.MAIN_PATH }}
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
retention-days: 5
- name: Publish Generated Pages
# only do this on master
if: github.event.inputs.commit_resources == 'true' || inputs.commit_resources == 'true'
if: github.event.inputs.commit_resources == 'true' || inputs.commit_resources == true
uses: stefanzweifel/[email protected]
with:
repository: ${{ env.MAIN_PATH }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/workflow-generate-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
id: checkout_latest_workflow
# use this for builds triggered from other workflows on protected branches
- name: Checkout Latest (using access_token)
if: github.event_name == 'push' && inputs.commit_resources == 'true'
if: github.event_name == 'push' && inputs.commit_resources == true
uses: actions/checkout@v3
with:
token: ${{ secrets.access_token }}
Expand Down Expand Up @@ -163,13 +163,13 @@ jobs:
script: |
core.setFailed('Link checker detected broken or invalid links, read attached report.')
- uses: actions/github-script@v3 # current: f05a81df23035049204b043b50c3322045ce7eb3
if: steps.linkchecker.outputs.exit_code != 0 && (github.event.inputs.bad_links_fail_build == 'true' || inputs.bad_links_fail_build == 'true')
if: steps.linkchecker.outputs.exit_code != 0 && (github.event.inputs.bad_links_fail_build == 'true' || inputs.bad_links_fail_build == true)
with:
script: |
core.setFailed('Link checker detected broken or invalid links, read attached report.')
- name: Deploy Website (using access_token)
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # current: v3
if: github.event_name == 'push' && inputs.commit_resources == 'true' && github.ref_name == 'main'
if: github.event_name == 'push' && inputs.commit_resources == true && github.ref_name == 'main'
with:
github_token: ${{ secrets.access_token }}
enable_jekyll: false
Expand Down

0 comments on commit 140f482

Please sign in to comment.