-
Notifications
You must be signed in to change notification settings - Fork 0
feat: announce new releases in Comms #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,8 +103,49 @@ jobs: | |
| echo "Newest tag ${new_tag} does not match package.json version ${package_version}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| package_name="$(node -p "JSON.parse(require('fs').readFileSync('package.json', 'utf8')).name")" | ||
| package_url="https://www.npmjs.com/package/${package_name}/v/${package_version}" | ||
| release_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${new_tag}" | ||
| repo_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" | ||
|
|
||
| if [ -n "${PREVIOUS_TAG}" ]; then | ||
| changelog="$(git log --no-merges --reverse --pretty='format:- %s (%H-%h)' "${PREVIOUS_TAG}..${new_tag}" | grep -v '^- chore(release): ' || true)" | ||
| else | ||
| changelog="$(git log --no-merges --reverse --pretty='format:- %s (%H-%h)' "${new_tag}" | grep -v '^- chore(release): ' || true)" | ||
| fi | ||
|
|
||
| if [ -z "${changelog}" ]; then | ||
| changelog='- No additional commits listed.' | ||
| else | ||
| changelog="$(printf '%s\n' "${changelog}" | sed -E -e 's,\(([a-f0-9]+)-([a-f0-9]+)\),([`\2`]('"${repo_url}"'/commit/\1)),g' | sed -E -e 's,\(#([0-9]+)\),([#\1]('"${repo_url}"'/pull/\1)),g')" | ||
| fi | ||
|
|
||
| echo "released=true" >> "$GITHUB_OUTPUT" | ||
| echo "version=${package_version}" >> "$GITHUB_OUTPUT" | ||
| { | ||
| echo "message<<EOF" | ||
| echo "**Comms MCP ${new_tag} published** 🚀" | ||
| echo | ||
| printf '%s\n' "${changelog}" | ||
| echo | ||
| echo "[GitHub release](${release_url}) | [npm package](${package_url})" | ||
| echo "EOF" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Announce release in Comms | ||
| if: ${{ steps.published.outputs.released == 'true' }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| uses: Doist/comms-actions/post-comment-action@aeeefe3270ad30d0c4cdd7dbf94b2fac1dcb8ceb | ||
| with: | ||
| comms-client-id: ${{ secrets.COMMS_DOISTBOT_CLIENT_ID }} | ||
| comms-client-secret: ${{ secrets.COMMS_DOISTBOT_CLIENT_SECRET }} | ||
| comms-username: ${{ secrets.COMMS_DOISTBOT_USER }} | ||
| comms-password: ${{ secrets.COMMS_DOISTBOT_PASSWORD }} | ||
| workspace-id: 69 | ||
| thread-id: CZER8KY4dS7idQxrb8hvg | ||
| content: ${{ steps.published.outputs.message }} | ||
| audience: thread | ||
| continue-on-error: true | ||
|
|
||
| - name: Generate todoist-ai-integrations token | ||
| if: ${{ !cancelled() && steps.published.outputs.released == 'true' }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(fullhash-shorthash)into a commit link is not anchored to end-of-line. The git log format (--pretty='format:- %s (%H-%h)') always appends the hash at the end of each line, so a commit message containing its own(hexstring-hexstring)pattern — e.g.,fix: handle (abc-def)— would cause the regex to match the wrong text and produce a spurious link.Add
$to anchor the match:(For clarity,
$goes before the closing,gin the pattern:\)$instead of\).)