Skip to content

Commit 25763b6

Browse files
authored
Merge pull request #53 from codellm-devkit/ci/notify-python-sdk-on-release
ci(release): auto-open a python-sdk incorporation issue on release
2 parents df81f18 + bf27563 commit 25763b6

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,47 @@ jobs:
181181
git add Formula/codeanalyzer-python.rb
182182
git commit -m "codeanalyzer-python ${VERSION}" || { echo "no formula change"; exit 0; }
183183
git push
184+
185+
# Open a tracking issue on the python-sdk (CLDK) consumer so its
186+
# codeanalyzer-python pin and integration can be brought up to this release.
187+
# The issue body is the CHANGELOG section for this version. Split into its own
188+
# job (needs: release) so a failure here -- e.g. a missing SDK_ISSUE_TOKEN --
189+
# is isolated from the PyPI and GitHub Release steps above. Issues are
190+
# repository-scoped (not branch-scoped), so this opens one on python-sdk.
191+
notify-python-sdk:
192+
needs: release
193+
if: startsWith(github.ref, 'refs/tags/')
194+
runs-on: ubuntu-latest
195+
steps:
196+
- name: Check out code
197+
uses: actions/checkout@v4
198+
199+
# Pull the lines under "## [VERSION]" up to the next "## [" heading.
200+
- name: Extract changelog section for this release
201+
run: |
202+
VERSION="${GITHUB_REF#refs/tags/v}"
203+
{
204+
echo "A new \`codeanalyzer-python\` release (\`v${VERSION}\`) is published."
205+
echo "Update the \`codeanalyzer-python\` pin in this repo and adapt the"
206+
echo "integration to the changes below (see \`PyCodeanalyzer._run_analyzer\`)."
207+
echo
208+
awk -v ver="$VERSION" '
209+
$0 ~ ("^## \\[" ver "\\]") { f = 1; print; next }
210+
f && /^## \[/ { exit }
211+
f { print }
212+
' CHANGELOG.md
213+
} > "$RUNNER_TEMP/sdk_issue.md"
214+
echo "----- issue body -----"; cat "$RUNNER_TEMP/sdk_issue.md"
215+
216+
- name: Create incorporation issue in python-sdk
217+
env:
218+
# PAT (or fine-grained token) with Issues:write on codellm-devkit/python-sdk.
219+
# The default GITHUB_TOKEN is scoped to this repo only and cannot open
220+
# issues cross-repo, mirroring HOMEBREW_TAP_TOKEN above.
221+
GH_TOKEN: ${{ secrets.SDK_ISSUE_TOKEN }}
222+
run: |
223+
VERSION="${GITHUB_REF#refs/tags/v}"
224+
gh issue create \
225+
--repo codellm-devkit/python-sdk \
226+
--title "Incorporate codeanalyzer-python v${VERSION}" \
227+
--body-file "$RUNNER_TEMP/sdk_issue.md"

0 commit comments

Comments
 (0)