Skip to content

Commit 504b7af

Browse files
committed
Add GitHub Actions workflow for Go docs update on tagged releases
- Introduced `godocs.yml` workflow to automate Go documentation updates when tags matching `vX.X.X` are pushed. - Verify tags are on the main branch before processing. - Use `actions/setup-go` to set up Go environment for the workflow. - Added Go proxy ping step to ensure update is queued.
1 parent 1388303 commit 504b7af

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/godocs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: godocs.yml
2+
on:
3+
push:
4+
tags:
5+
- 'v[0-9]*.[0-9]*.[0-9]*'
6+
7+
env:
8+
GO_VERSION: '1.24'
9+
10+
jobs:
11+
update-go-docs:
12+
name: Update Go Docs
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout main and all tags
16+
uses: actions/checkout@v4
17+
with:
18+
ref: main
19+
fetch-depth: 0
20+
21+
- name: Verify tag is on main branch
22+
run: |
23+
if git branch -r --contains ${{ github.ref_name }} | grep -qw "origin/main"; then
24+
echo "✅ Tag ${{ github.ref_name }} found on main branch."
25+
else
26+
echo "❌ Tag ${{ github.ref_name }} is not on main branch. Aborting."
27+
exit 1
28+
fi
29+
30+
- name: Setup Go
31+
uses: actions/setup-go@v5
32+
with:
33+
go-version: ${{ env.GO_VERSION }}
34+
35+
- name: Ping Go Proxy
36+
run: |
37+
GOPROXY=proxy.golang.org go list -m github.com/${{ github.repository }}@${{ github.ref_name }}

0 commit comments

Comments
 (0)