From a0ec8ceff969947a685ab976152ca6784923d594 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 18 Jul 2023 09:00:08 -0700 Subject: [PATCH] Add several improvements to GHA example - "workflow_dispatch" so we can trigger manually - "concurrency" so we avoid over-triggering when updating PRs/branches - multi-line string in GITHUB_OUTPUT for better output and less flakiness --- scripts/github-actions/example-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/github-actions/example-ci.yml b/scripts/github-actions/example-ci.yml index 3860c115..60de5597 100644 --- a/scripts/github-actions/example-ci.yml +++ b/scripts/github-actions/example-ci.yml @@ -3,6 +3,7 @@ name: GitHub CI on: pull_request: push: + workflow_dispatch: schedule: - cron: 0 0 * * 0 @@ -10,6 +11,10 @@ defaults: run: shell: 'bash -Eeuo pipefail -x {0}' +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: generate-jobs: @@ -24,8 +29,11 @@ jobs: name: Generate Jobs run: | strategy="$("$BASHBREW_SCRIPTS/github-actions/generate.sh")" - echo "strategy=$strategy" >> "$GITHUB_OUTPUT" - jq . <<<"$strategy" # sanity check / debugging aid + + EOF="EOF-$RANDOM-$RANDOM-$RANDOM" + echo "strategy<<$EOF" >> "$GITHUB_OUTPUT" + jq <<<"$strategy" . | tee -a "$GITHUB_OUTPUT" + echo "$EOF" >> "$GITHUB_OUTPUT" test: needs: generate-jobs