Repository navigation
Expand file tree
/
Copy pathsync-client-library-release-notes.yml
More file actions
163 lines (150 loc) · 6.07 KB
/
Copy pathsync-client-library-release-notes.yml
File metadata and controls
163 lines (150 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Sync client library release notes
on:
schedule:
# 06:00 UTC daily — quiet hours for US reviewers, PR ready by morning.
- cron: '0 6 * * *'
workflow_dispatch:
inputs:
client:
description: 'Client to sync (python, go, javascript, csharp, java, rust, or all)'
required: true
default: 'all'
type: choice
options:
- all
- python
- go
- javascript
- csharp
- java
- rust
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout docs-v2
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: docs-v2
- name: Checkout influxdb3-python
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: InfluxCommunity/influxdb3-python
path: sources/influxdb3-python
sparse-checkout: |
CHANGELOG.md
- name: Checkout influxdb3-go
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: InfluxCommunity/influxdb3-go
path: sources/influxdb3-go
sparse-checkout: |
CHANGELOG.md
- name: Checkout influxdb3-js
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: InfluxCommunity/influxdb3-js
path: sources/influxdb3-js
sparse-checkout: |
CHANGELOG.md
- name: Checkout influxdb3-csharp
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: InfluxCommunity/influxdb3-csharp
path: sources/influxdb3-csharp
sparse-checkout: |
CHANGELOG.md
- name: Checkout influxdb3-java
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: InfluxCommunity/influxdb3-java
path: sources/influxdb3-java
sparse-checkout: |
CHANGELOG.md
- name: Checkout influxdb3-rust
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: InfluxCommunity/influxdb3-rust
path: sources/influxdb3-rust
sparse-checkout: |
CHANGELOG.md
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: docs-v2/.nvmrc
- name: Run sync
id: sync
working-directory: docs-v2
run: |
CLIENT="${{ github.event.inputs.client || 'all' }}"
if [ "$CLIENT" = "all" ]; then
node helper-scripts/client-libraries/sync-release-notes.js \
--all \
--source-root "$GITHUB_WORKSPACE/sources" \
--docs-root "$GITHUB_WORKSPACE/docs-v2"
else
# Map client slug to repo directory (javascript -> influxdb3-js).
case "$CLIENT" in
javascript) REPO_DIR=influxdb3-js ;;
*) REPO_DIR="influxdb3-$CLIENT" ;;
esac
node helper-scripts/client-libraries/sync-release-notes.js \
--client "$CLIENT" \
--source-path "$GITHUB_WORKSPACE/sources/$REPO_DIR" \
--docs-root "$GITHUB_WORKSPACE/docs-v2"
fi
- name: Compose PR body
id: body
env:
NEEDS_ATTENTION: ${{ steps.sync.outputs.needs_attention }}
SUMMARY: ${{ steps.sync.outputs.summary }}
run: |
BODY_FILE="$RUNNER_TEMP/pr-body.md"
{
if [ "$NEEDS_ATTENTION" = "true" ]; then
echo '> [!Warning]'
echo '> One or more client libraries were skipped or failed to parse.'
echo '> Investigate upstream CHANGELOG changes (rename, format change)'
echo '> before merging — assigned to @Copilot for triage.'
echo
fi
echo 'Automated sync from the v3 client library CHANGELOGs.'
echo
echo '## Sync results'
echo
printf '%s\n' "$SUMMARY"
echo
echo '## Sources'
echo
echo '- https://github.com/InfluxCommunity/influxdb3-python/blob/main/CHANGELOG.md'
echo '- https://github.com/InfluxCommunity/influxdb3-go/blob/main/CHANGELOG.md'
echo '- https://github.com/InfluxCommunity/influxdb3-js/blob/main/CHANGELOG.md'
echo '- https://github.com/InfluxCommunity/influxdb3-csharp/blob/main/CHANGELOG.md'
echo '- https://github.com/InfluxCommunity/influxdb3-java/blob/main/CHANGELOG.md'
echo '- https://github.com/InfluxCommunity/influxdb3-rust/blob/main/CHANGELOG.md'
echo
echo 'Changed files include body-only release notes under'
echo '`content/shared/influxdb-client-libraries-reference/v3/release-notes/`'
echo 'and `latest_version` / `latest_release_date` frontmatter updates'
echo 'on the per-product stubs under'
echo '`content/influxdb3/*/reference/client-libraries/v3/*/release-notes.md`.'
} > "$BODY_FILE"
echo "path=$BODY_FILE" >> "$GITHUB_OUTPUT"
- name: Create or update pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
with:
path: docs-v2
branch: sync/client-library-release-notes
commit-message: 'sync(client-libs): update release notes'
title: 'sync(client-libs): update release notes'
body-path: ${{ steps.body.outputs.path }}
# Assign the Copilot coding agent only when a client was skipped or
# failed to parse, so it can investigate upstream CHANGELOG drift.
# Requires Copilot coding agent to be enabled on the repository.
assignees: ${{ steps.sync.outputs.needs_attention == 'true' && 'Copilot' || '' }}
labels: |
sync
client-libraries