Repository navigation
UN-2686 ci: auto-release conflict-free bot SDK release PRs - #768
Merged
Merged
Conversation
Rewrite on-pd-bot-pr-opened workflow to add the npm-ready-for-publish label (via GitHub App token) to the oldest conflict-free SDK release PR opened by pipedrive-github-actions-bot, and alert Slack on conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Compliance checkRun: 45622601495 ✅ Compliance reportCompliance Check: PassedScope: branch Failed rulesAll compliance rules passed. Pre-existing failures
Template #297: Security by Design Checklist v1Notices
Passed rules (1)
N/A rules (149)
Template #503: PR Release Checklist v1N/A rules (10)
Evaluated by compliance-engine:compliance-check. Templates: #297, #503 |
Author
Jira relevance check (UN-2686): RelevantThe PR changes one file, How the diff matches the acceptance criteria
Points to check (not blocking for relevance)
|
youssef-saber-3
marked this pull request as ready for review
November 25, 2026 13:57
youssef-saber-3
approved these changes
Nov 25, 2026
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR rewrites
.github/workflows/on-pd-bot-pr-opened.yml. With it, the bot's "Build N - version-X" release PRs are published to npm without anyone adding a label by hand.cicd_npm-publish.ymlis not changed.What the workflow does
pull_requestonmaster(labeled,synchronize,reopened,closed) andworkflow_dispatch. The job runs only for PRs authored bypipedrive-github-actions-bot[bot]. The oldpipedrive-botactor check is removed. Forlabeledevents, the label must benpm-version-*. This also means the workflow does not react to thenpm-ready-for-publishlabel it adds itself. The existing guard against PRs that already havenpm-ready-for-publishis kept.npm-version-*label) and works only on that one. Newer PRs wait. Becauseclosedis a trigger, the next PR is picked up once the older one is merged or closed. Becausesynchronizeandreopenedare triggers, a PR is picked up again after someone fixes its CHANGELOG by hand. A non-cancellingconcurrencygroup stops two runs from labeling PRs at the same time. Evaluating the oldest PR on every run means a dropped pending run cannot leave the queue stuck. If the oldest PR already hasnpm-ready-for-publish, the run does nothing because publishing is already in progress.mergeablefield while it isnull(up to about 2 minutes). Ifmergeable == falseormergeable_state == dirty, the PR is not labeled. Instead, a Slack alert with the PR link and title is sent. The alert is sent only when the event is about the oldest PR itself, or onclosed/ manual runs, so pushes to newer PRs don't repeat it. If mergeability is still unknown after polling, the job fails and does not label the PR.npm ci --ignore-scriptsandnpx changelog-updater --check. It then addsnpm-ready-for-publishwith a GitHub App installation token fromactions/create-github-app-token@v3. This is the same App the reusable npm publish workflow already uses in this repo. Events created by an App token trigger other workflows, socicd_npm-publish.ymlthen publishes and merges the PR. Events created withGITHUB_TOKENwould not.setup-nodenow usesnode-version-file: .nvmrcinstead of the deprecated::set-output. The default token gets minimal read permissions. The approval step is removed because publishing doesn't need it.Needs action after merge / before relying on it
slackapi/slack-github-action@v2and needs a bot token secret that can post to the alert channel. Confirm the secret exists in this repo and rename it in the workflow if needed.Known limitation: if the publish run fails after labeling, the oldest PR keeps
npm-ready-for-publishand the queue stops at it until someone deals with it. This is intentional, so a failed release is never silently skipped.Type of PR?
Manual testing
actionlint. It passes, apart from one false positive: its bundled metadata is stale and doesn't know theclient-idinput. I checked the upstreamactions/create-github-app-token@v3action.yml, and it definesclient-id.jqfilter against the live client-nodejs API (read-only). It matches Build 364 - version-major #767 (bot author plusnpm-version-major). No bot PRs are open right now, so a run today would exit with nothing to do.Automated tests added?