From afe8e6c815b37f4c025bb0a9a66aab31fdcce165 Mon Sep 17 00:00:00 2001 From: kendal Date: Wed, 22 May 2024 14:39:49 -0700 Subject: [PATCH] Add a job summary --- .github/workflows/test.yml | 6 +++--- action.yml | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4fe3e6..d69a679 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,9 +15,9 @@ jobs: - name: Run this action uses: ./ with: - fork_repo: thebrowsercompany/firebase-cpp-sdk - fork_branch: compnerd/swift - upstream_repo: firebase/firebase-cpp-sdk + fork_repo: kendalharland/swift-build + fork_branch: main + upstream_repo: compnerd/swift-build upstream_branch: main dry_run: true diff --git a/action.yml b/action.yml index e4f46ee..350564d 100644 --- a/action.yml +++ b/action.yml @@ -52,6 +52,22 @@ runs: git remote add upstream https://${{ inputs.upstream_host }}/${{ inputs.upstream_repo }} git fetch upstream ${{ inputs.upstream_branch }} + + # Store the list of commits we're about to rebase as a job summary: + $NewCommitsFromUpstream=(git log --format="[%h] %s" --no-merges upstream/${{ inputs.upstream_branch }} ^${{ inputs.fork_branch }}) + echo "``````mermaid" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + echo "gitGraph TB:" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + echo "options" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + echo "{" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + echo " `"mainBranchName`": `"${{ inputs.upstream_repo}}/${{ inputs.upstream_branch }}`"" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + echo "}" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + echo "end" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + foreach ($Commit in $NewCommitsFromUpstream) { + $Commit=$Commit -replace "`"","'" + echo "commit id: `"${Commit}`"" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + } + echo "``````" | Out-File -Append -Encoding utf8 $env:GITHUB_STEP_SUMMARY + git checkout ${{ inputs.fork_branch }} git rebase upstream/${{ inputs.upstream_branch }}