|
26 | 26 | # Allow manually running the action, e.g. if disabled after some quietness in the source |
27 | 27 |
|
28 | 28 | permissions: |
| 29 | + checks: write |
29 | 30 | contents: write |
30 | 31 | issues: write |
31 | 32 | pull-requests: write |
|
43 | 44 | fail-fast: false |
44 | 45 |
|
45 | 46 | steps: |
| 47 | + # PoC, see https://github.com/LouisBrunner/checks-action |
| 48 | + # and https://powgs.freetls.fastly.net/mirror/misskey/-/blob/develop/.github/workflows/pr-preview-deploy.yml |
| 49 | + # and e.g. https://api.github.com/repos/networkupstools/nut/commits/973fb587ebcf904bcfff869c3577e91cbb03e708/check-runs |
| 50 | + - uses: actions/github-script@v6.3.3 |
| 51 | + id: job-check-id |
| 52 | + env: |
| 53 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 54 | + job: "Make Dist and Docs Tarballs" |
| 55 | + ### This gives "make-dist-tarballs": |
| 56 | + job_id: ${{ github.job }} |
| 57 | + run_id: ${{ github.run_id }} |
| 58 | + with: |
| 59 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + result-encoding: string |
| 61 | + script: | |
| 62 | + const ref = process.env.ref; |
| 63 | + const { data: checks } = await github.rest.checks.listForRef({ |
| 64 | + ...context.repo, |
| 65 | + ref |
| 66 | + }); |
| 67 | +
|
| 68 | + const check = checks.check_runs.filter(c => c.name === process.env.job); |
| 69 | +
|
| 70 | + return check[0].id; |
| 71 | +
|
| 72 | +
|
| 73 | + - name: "GHA-01: Change this GH Check report" |
| 74 | + uses: LouisBrunner/checks-action@v2.0.0 |
| 75 | + if: always() |
| 76 | + #continue-on-error: true |
| 77 | + env: |
| 78 | + check_id: ${{ steps.job-check-id.outputs.result }} |
| 79 | + with: |
| 80 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 81 | + check_id: ${{ env.check_id }} |
| 82 | + #check_id: ${{ github.run_id }} |
| 83 | + #name: "GHA-01: Make dist and docs tarballs, see workflow page for links" |
| 84 | + status: "in_progress" |
| 85 | + details_url: http://localhost |
| 86 | + output: '{ "text_description": "Dist and Docs tarballs will be linked here after the `make dist` job completes", "summary": "in_progress"}' |
| 87 | + |
46 | 88 | # Post early so this would be about the top comment in the PR trail |
47 | 89 | # (easy to see, contents replaced later) |
48 | 90 | - name: "GHA-01: Make dist and docs tarballs - report download URL (placeholder) as a first-ever PR comment" |
|
0 commit comments