|
1 |
| -name: godoc_pr_preview |
2 |
| - |
3 |
| -on: |
4 |
| - pull_request: |
5 |
| - types: |
6 |
| - - opened |
7 |
| - - synchronize |
8 |
| - |
9 |
| -jobs: |
10 |
| - request_documentation: |
11 |
| - runs-on: ubuntu-latest |
12 |
| - |
13 |
| - steps: |
14 |
| - - name: Set up Go |
15 |
| - uses: actions/setup-go@v2 |
16 |
| - with: |
17 |
| - go-version: 1.21 |
18 |
| - |
19 |
| - - name: Generate comment |
20 |
| - id: generate_comment |
21 |
| - run: | |
22 |
| - set -x |
23 |
| - version=$(go mod download --json $REPO@$REV | jq -r .Version) |
24 |
| - echo "Module version: $version" |
25 |
| - echo "version=$version" >> "$GITHUB_OUTPUT" |
26 |
| -
|
27 |
| - link="https://godocs.io/$REPO@$version" |
28 |
| - comment="### godoc reference preview ready ✨<br>[]($link)" |
29 |
| - echo "comment=$comment" >> "$GITHUB_OUTPUT" |
30 |
| - env: |
31 |
| - REPO: github.com/${{ github.event.pull_request.base.repo.full_name }} |
32 |
| - REV: ${{ github.event.pull_request.head.sha }} |
33 |
| - |
34 |
| - - name: Update existing issue comment |
35 |
| - uses: peter-evans/find-comment@v1 |
36 |
| - id: fc |
37 |
| - with: |
38 |
| - issue-number: ${{ github.event.pull_request.number }} |
39 |
| - comment-author: "github-actions[bot]" |
40 |
| - body-includes: "### godoc reference preview ready ✨" |
41 |
| - edit-mode: replace |
42 |
| - |
43 |
| - - name: Update comment |
44 |
| - if: steps.fc.outputs.comment-id != '' |
45 |
| - uses: peter-evans/create-or-update-comment@v1 |
46 |
| - with: |
47 |
| - comment-id: ${{ steps.fc.outputs.comment-id }} |
48 |
| - body: ${{ steps.generate_comment.outputs.comment }} |
49 |
| - edit-mode: replace |
| 1 | +name: godoc_pr_preview |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - opened |
| 7 | + - synchronize |
| 8 | + |
| 9 | +jobs: |
| 10 | + request_documentation: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Set up Go |
| 15 | + uses: actions/setup-go@v2 |
| 16 | + with: |
| 17 | + go-version: 1.21 |
| 18 | + |
| 19 | + - name: Generate comment |
| 20 | + id: generate_comment |
| 21 | + run: | |
| 22 | + set -x |
| 23 | + version=$(go mod download --json $REPO@$REV | jq -r .Version) |
| 24 | + echo "Module version: $version" |
| 25 | + echo "version=$version" >> "$GITHUB_OUTPUT" |
| 26 | +
|
| 27 | + link="https://godocs.io/$REPO@$version" |
| 28 | + comment="### godoc reference preview ready ✨<br>[]($link)" |
| 29 | + echo "comment=$comment" >> "$GITHUB_OUTPUT" |
| 30 | + env: |
| 31 | + REPO: github.com/${{ github.event.pull_request.base.repo.full_name }} |
| 32 | + REV: ${{ github.event.pull_request.head.sha }} |
| 33 | + |
| 34 | + - name: Update existing issue comment |
| 35 | + uses: peter-evans/find-comment@v1 |
| 36 | + id: fc |
| 37 | + with: |
| 38 | + issue-number: ${{ github.event.pull_request.number }} |
| 39 | + comment-author: "github-actions[bot]" |
| 40 | + body-includes: "### godoc reference preview ready ✨" |
| 41 | + edit-mode: replace |
| 42 | + |
| 43 | + - name: Update comment |
| 44 | + if: steps.fc.outputs.comment-id != '' |
| 45 | + uses: peter-evans/create-or-update-comment@v1 |
| 46 | + with: |
| 47 | + comment-id: ${{ steps.fc.outputs.comment-id }} |
| 48 | + body: ${{ steps.generate_comment.outputs.comment }} |
| 49 | + edit-mode: replace |
0 commit comments