File tree Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,22 @@ echo ""
182182
183183if [[ $EXIT_CODE -eq 0 ]]; then
184184 echo -e " ${GREEN} ✓ All code references are valid!${NC} "
185+
186+ # If in PR comment mode, write success message to file
187+ if [[ -n " ${COMMENT_FILE} " ]]; then
188+ cat > " ${COMMENT_FILE} " << EOF
189+ ## ✓ Code Reference Verification Passed
190+
191+ All code references in the documentation have been verified successfully!
192+
193+ **Total references checked:** ${TOTAL_REFS}
194+ **Valid references:** ${VALID_REFS}
195+
196+ The documentation is in sync with the codebase on the \` develop\` branch.
197+ EOF
198+ echo " "
199+ echo " PR success comment written to: ${COMMENT_FILE} "
200+ fi
185201else
186202 echo -e " ${RED} ✗ Some code references are invalid. Please update the documentation.${NC} "
187203
Original file line number Diff line number Diff line change @@ -57,16 +57,16 @@ jobs:
5757 run : |
5858 bash .github/scripts/verify-code-references.sh --pr-comment /tmp/pr-comment.md
5959 if [ -f /tmp/pr-comment.md ]; then
60- echo "has_errors =true" >> $GITHUB_OUTPUT
60+ echo "has_comment =true" >> $GITHUB_OUTPUT
6161 echo "Comment file created, will post to PR"
6262 cat /tmp/pr-comment.md
6363 else
64- echo "has_errors =false" >> $GITHUB_OUTPUT
65- echo "No errors found, no comment needed "
64+ echo "has_comment =false" >> $GITHUB_OUTPUT
65+ echo "No comment file created "
6666 fi
6767
68- - name : Comment PR on verification failure
69- if : github.event_name == 'pull_request' && steps.verify-pr.outputs.has_errors == 'true'
68+ - name : Comment PR with verification results
69+ if : github.event_name == 'pull_request' && steps.verify-pr.outputs.has_comment == 'true'
7070 uses : thollander/actions-comment-pull-request@v3
7171 with :
7272 file-path : /tmp/pr-comment.md
Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ https://github.com/o1-labs/mina-rust/blob/develop/path/to/file.rs#LStartLine-LEn
3535
3636Here's a real example from the zkApps documentation:
3737
38- <!-- CODE_REFERENCE: ledger/src/scan_state/transaction_logic.rs#L3588-L3592 -->
38+ <!-- CODE_REFERENCE: ledger/src/scan_state/transaction_logic/valid .rs#L80-L83 -->
3939
40- ``` rust reference title="ledger/src/scan_state/transaction_logic.rs"
41- https : // github.com/o1-labs/mina-rust/blob/develop/ledger/src/scan_state/transaction_logic.rs#L3588-L3592
40+ ``` rust reference title="ledger/src/scan_state/transaction_logic/valid .rs"
41+ https : // github.com/o1-labs/mina-rust/blob/develop/ledger/src/scan_state/transaction_logic/valid .rs#L80-L83
4242```
4343
4444### Components explained
You can’t perform that action at this time.
0 commit comments