From 5aaea5b8edbce742f15847001f68fca6a721f928 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Sun, 22 Sep 2024 17:44:03 +0100 Subject: [PATCH] ci: add link back to workflow summary in pr comment --- .github/workflows/ci-comment.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-comment.yml b/.github/workflows/ci-comment.yml index 68d67624b..9627ba848 100644 --- a/.github/workflows/ci-comment.yml +++ b/.github/workflows/ci-comment.yml @@ -31,16 +31,30 @@ jobs: path: summaries github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Debug - run: ls -R + - name: Get workflow URL + id: workflow-url + run: | + repo_url="${{ github.server_url }}/${{ github.repository }}" + echo "url=$repo_url/actions/runs/${{ github.run_id }}" >> $GITHUB_OUTPUT + shell: bash - name: Merge summaries id: summary run: | + files=$(ls summaries) + if [ -z "$files" ]; then + echo "No summaries found" + exit 0 + fi + echo "message<> $GITHUB_OUTPUT + echo "## CI Summary" >> $GITHUB_OUTPUT + for file in summaries/*; do echo $(cat $file) >> $GITHUB_OUTPUT done + + echo "[Full summary](${{ steps.workflow-url.outputs.url }})" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Set PR comment