Skip to content

Refactor: Domain and DTO models #171

Refactor: Domain and DTO models

Refactor: Domain and DTO models #171

Workflow file for this run

name: Godoc
on:
pull_request:
types:
- opened
- synchronize
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/godoc.yaml"
jobs:
build:
name: PR Preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 1.24.3
- name: Generate comment
id: generate_comment
run: |
set -x
version=$(go mod download --json $REPO@$REV | jq -r .Version)
echo "Module version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
link="https://godocs.io/$REPO@$version"
comment="### godoc reference preview ready ✨<br>[![Go Documentation](https://godocs.io/github.com/acmcsufoss/api.acmcsuf.com?status.svg)]($link)"
echo "comment=$comment" >> "$GITHUB_OUTPUT"
env:
REPO: github.com/${{ github.event.pull_request.base.repo.full_name }}
REV: ${{ github.event.pull_request.head.sha }}
- name: Find existing comment
uses: peter-evans/find-comment@v4
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "### godoc reference preview ready ✨"
- name: Create comment
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.generate_comment.outputs.comment }}
- name: Update comment
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: ${{ steps.generate_comment.outputs.comment }}
edit-mode: replace