Datasets:

ArXiv:
Felipe commited on
Commit
7d88ec4
ยท
unverified ยท
1 Parent(s): 1d05092

Fix PR preview workflow - remove broken live preview link (#10)

Browse files
Files changed (1) hide show
  1. .github/workflows/pr-preview.yml +15 -30
.github/workflows/pr-preview.yml CHANGED
@@ -11,13 +11,13 @@ jobs:
11
  permissions:
12
  contents: read
13
  pull-requests: write
14
-
15
  steps:
16
  - name: Checkout PR
17
  uses: actions/checkout@v4
18
 
19
  - name: Set up Python
20
- uses: actions/setup-python@v4
21
  with:
22
  python-version: '3.x'
23
 
@@ -34,52 +34,37 @@ jobs:
34
  path: index.html
35
  retention-days: 7
36
 
37
- - name: Deploy preview (if Pages enabled)
38
- uses: peaceiris/actions-gh-pages@v4
39
- continue-on-error: true
40
- with:
41
- github_token: ${{ secrets.GITHUB_TOKEN }}
42
- publish_dir: .
43
- destination_dir: pr-${{ github.event.number }}
44
- keep_files: false
45
-
46
  - name: Comment PR with preview link
47
- uses: actions/github-script@v6
48
  with:
49
  script: |
50
  const prNumber = context.payload.pull_request.number;
51
  const repoOwner = context.repo.owner;
52
  const repoName = context.repo.repo;
53
- const previewUrl = `https://${repoOwner}.github.io/${repoName}/pr-${prNumber}/`;
54
-
55
  const comment = `## ๐Ÿ” Website Preview
56
-
57
- Your changes have been processed!
58
-
59
- **๐Ÿ“„ Preview Artifact:** Check the "website-preview" artifact above to download the generated HTML file.
60
-
61
- ${previewUrl ? `**๐ŸŒ Live Preview:** ${previewUrl}` : '**โ„น๏ธ Live preview:** GitHub Pages not configured for this repository.'}
62
-
63
  ---
64
-
65
- ### ๐Ÿ› ๏ธ How to test locally:
66
  \`\`\`bash
67
- # Clone and test your changes
68
  git checkout ${{ github.head_ref }}
69
- python .github/workflows/website.py
70
- python -m http.server 8000
71
- # Visit: http://localhost:8000
72
  \`\`\`
73
-
74
  ### โœ… Validation Status:
75
  - โœ… Website generated successfully
76
  - โœ… Table format validated
77
  - โœ… Ready for review
78
  `;
79
-
80
  github.rest.issues.createComment({
81
  issue_number: prNumber,
82
  owner: repoOwner,
83
  repo: repoName,
84
  body: comment
85
- });
 
11
  permissions:
12
  contents: read
13
  pull-requests: write
14
+
15
  steps:
16
  - name: Checkout PR
17
  uses: actions/checkout@v4
18
 
19
  - name: Set up Python
20
+ uses: actions/setup-python@v5
21
  with:
22
  python-version: '3.x'
23
 
 
34
  path: index.html
35
  retention-days: 7
36
 
 
 
 
 
 
 
 
 
 
37
  - name: Comment PR with preview link
38
+ uses: actions/github-script@v7
39
  with:
40
  script: |
41
  const prNumber = context.payload.pull_request.number;
42
  const repoOwner = context.repo.owner;
43
  const repoName = context.repo.repo;
44
+
 
45
  const comment = `## ๐Ÿ” Website Preview
46
+
47
+ Your changes have been processed!
48
+
49
+ **๐Ÿ“„ Preview Artifact:** Download the "website-preview" artifact from the Actions tab to view the generated HTML.
50
+
 
 
51
  ---
52
+
53
+ ### ๐Ÿ› ๏ธ Test locally:
54
  \`\`\`bash
 
55
  git checkout ${{ github.head_ref }}
56
+ python scripts/dev-preview.py
 
 
57
  \`\`\`
58
+
59
  ### โœ… Validation Status:
60
  - โœ… Website generated successfully
61
  - โœ… Table format validated
62
  - โœ… Ready for review
63
  `;
64
+
65
  github.rest.issues.createComment({
66
  issue_number: prNumber,
67
  owner: repoOwner,
68
  repo: repoName,
69
  body: comment
70
+ });