|
1 | 1 | name: CI |
2 | 2 |
|
3 | | -on: |
4 | | - pull_request: |
5 | | - push: |
| 3 | +on: [pull_request, push] |
| 4 | + |
| 5 | +permissions: |
| 6 | + checks: write |
6 | 7 |
|
7 | 8 | env: |
8 | 9 | MIX_ENV: test |
@@ -55,43 +56,29 @@ jobs: |
55 | 56 | path: doc/ |
56 | 57 | overwrite: true |
57 | 58 |
|
58 | | - - name: Build update |
| 59 | + - name: Docs report |
59 | 60 | uses: actions/github-script@v7 |
60 | | - if: github.event_name == 'pull_request' |
| 61 | + continue-on-error: true |
61 | 62 | env: |
62 | 63 | ARTIFACT_ID: ${{ steps.docs-upload.outputs.artifact-id }} |
63 | 64 | with: |
64 | 65 | script: | |
65 | 66 | const artifactUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts/${process.env.ARTIFACT_ID}`; |
66 | | - const commentBody = `<!-- build-artifact-comment -->\n📦 Docs artifacts are ready: ${artifactUrl}`; |
67 | 67 |
|
68 | | - const comments = await github.rest.issues.listComments({ |
| 68 | + await github.rest.checks.create({ |
69 | 69 | owner: context.repo.owner, |
70 | 70 | repo: context.repo.repo, |
71 | | - issue_number: context.issue.number, |
| 71 | + name: 'Docs artifacts', |
| 72 | + head_sha: context.sha, |
| 73 | + status: 'completed', |
| 74 | + conclusion: 'success', |
| 75 | + output: { |
| 76 | + title: '', |
| 77 | + summary: '', |
| 78 | + text: artifactUrl |
| 79 | + } |
72 | 80 | }); |
73 | 81 |
|
74 | | - const botComment = comments.data.find(comment => |
75 | | - comment.user.type === 'Bot' && |
76 | | - comment.body.includes('<!-- build-artifact-comment -->') |
77 | | - ); |
78 | | -
|
79 | | - if (botComment) { |
80 | | - await github.rest.issues.updateComment({ |
81 | | - owner: context.repo.owner, |
82 | | - repo: context.repo.repo, |
83 | | - comment_id: botComment.id, |
84 | | - body: commentBody |
85 | | - }); |
86 | | - } else { |
87 | | - await github.rest.issues.createComment({ |
88 | | - owner: context.repo.owner, |
89 | | - repo: context.repo.repo, |
90 | | - issue_number: context.issue.number, |
91 | | - body: commentBody |
92 | | - }); |
93 | | - } |
94 | | -
|
95 | 82 | # Test Elixir |
96 | 83 | - run: mix format --check-formatted |
97 | 84 | - run: mix deps.unlock --check-unused |
|
0 commit comments