Skip to content

Commit

Permalink
Attempt to work around inputs on a scheduled workflow run
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk committed Oct 9, 2023
1 parent 357026e commit 010f0f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/update-build-time-diagrams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# At 23:00
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
- cron: "0 23 * * *"
- cron: "20 11 * * *"

workflow_dispatch:
inputs:
Expand Down Expand Up @@ -69,18 +70,21 @@ jobs:
- name: "Update build stats and re-generate diagrams"
shell: bash -e {0}
env:
get_stats: ${{ github.event_name == 'schedule' && true || github.event.inputs.get_stats }}
create_diagrams: ${{ github.event_name == 'schedule' && true || github.event.inputs.create_diagrams }}
run: |
if ${{ inputs.get_stats }}; then
if ${{ env.get_stats }}; then
main/build-stats/get-build-stats.py | tee -a gh-pages/build-stats.csv
git -C gh-pages add build-stats.csv
fi
if ${{ inputs.create_diagrams }}; then
if ${{ env.create_diagrams }}; then
main/build-stats/create-diagrams.py --datafile gh-pages/build-stats.csv
mv index.html gh-pages/index.html
mv fig-*.html gh-pages/
git -C gh-pages add index.html fig-*.html
fi
if [[ ${{ inputs.get_stats }} || ${{ inputs.create_diagrams }} ]]; then
if [[ ${{ env.get_stats }} || ${{ env.create_diagrams }} ]]; then
cd gh-pages
git commit -m "Automatically update stats build stats"
git push origin HEAD:gh-pages
Expand Down

0 comments on commit 010f0f5

Please sign in to comment.