Skip to content

Commit af1b2b1

Browse files
committed
Add step to create check run with doc link
1 parent 7ae4b95 commit af1b2b1

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/build-deploy-docs.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ jobs:
6363
external_repository: TorchJD/documentation
6464
publish_branch: main
6565

66-
- name: Add documentation link to summary
67-
run: |
68-
echo "### 📄 [View Deployed Documentation](https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }})" >> $GITHUB_STEP_SUMMARY
66+
- name: Create Check Run with Docs Link
67+
uses: actions/github-script@v7
68+
with:
69+
script: |
70+
const repo = context.repo;
71+
const url = `https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }}`;
72+
73+
const checkRun = await github.rest.checks.create({
74+
owner: repo.owner,
75+
repo: repo.repo,
76+
name: "📘 View Documentation",
77+
head_sha: context.payload.pull_request.head.sha,
78+
status: "completed",
79+
conclusion: "success",
80+
details_url: url
81+
});
82+
83+
console.log(`Check Run Created: ${checkRun.data.html_url}`);

0 commit comments

Comments
 (0)