Skip to content

Commit

Permalink
Add a job summary
Browse files Browse the repository at this point in the history
  • Loading branch information
kendal committed May 22, 2024
1 parent fbddc64 commit afe8e6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit afe8e6c

Please sign in to comment.