cal-itp / reports

GTFS data quality reports for California transit providers
https://reports.calitp.org
GNU Affero General Public License v3.0
7 stars 0 forks source link

workflow_dispatch doesn't quite work as intended #285

Closed edasmalchi closed 11 months ago

edasmalchi commented 11 months ago

I tried adding manual Workflow Dispatch triggers to the site build GH action in #279, but it doesn't quite work as-intended. When triggering manually, dev actions always run regardless of dev/prod selection, and prod site deploy will not run at all.

if: ${{ github.ref == 'refs/heads/main' || inputs.site_target == 'dev'}} conditionals always evaluate to true, even when triggered with workflow_dispatch github.ref is 'refs/heads/main'. One option would be to make check trigger (push, tag, workflow_dispatch) in addition

https://github.com/cal-itp/reports/blob/8d0403a8e0c1a2a8c5d32679bd028607488b4a2c/.github/workflows/main.yml#L48C7-L48C79

|| operator should be outside parens:

https://github.com/cal-itp/reports/blob/8d0403a8e0c1a2a8c5d32679bd028607488b4a2c/.github/workflows/main.yml#L79C43-L79C43

edasmalchi commented 11 months ago

see https://docs.github.com/en/actions/learn-github-actions/contexts#about-contexts, https://docs.github.com/en/actions/learn-github-actions/expressions

more verbose option to test: if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.site_target == 'dev')}}