Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d073e94
Add AzDO pipeline to bump decoupled local dependencies after publish
iclanton Feb 21, 2026
f934b71
Fix GitHub PR step to show API error responses on failure
iclanton Feb 21, 2026
e9dabf8
Use service connection credentials from git config for GitHub API calls
iclanton Feb 21, 2026
f206d7d
Extract push + GitHub PR steps into a reusable template
iclanton Feb 22, 2026
c384780
Address PR review: sanitize inputs, protect credentials, add security…
iclanton Feb 22, 2026
0ac60c3
Rename to npm-post-publish, publish api artifact, add API docs update…
iclanton Feb 22, 2026
86170f5
Rename to npm-post-publish, add api artifact, add API docs update sta…
iclanton Feb 22, 2026
1e5760c
Extract api artifact publishing to separate branch
iclanton Feb 22, 2026
b7045fa
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 22, 2026
8d8bac6
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 22, 2026
8c803ef
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
63137c0
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
a33d3ce
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
1652350
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
10dade8
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
2797344
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
0ac30e7
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
728b415
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
59b9867
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
8963a0e
Only install to repo-toolbox.
iclanton Feb 23, 2026
7bbe316
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
d5645af
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
a204ddd
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
b4be874
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
4b5069d
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
ba040aa
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
d3bb564
fixup! Rename to npm-post-publish, add api artifact, add API docs upd…
iclanton Feb 23, 2026
f62258a
TEMP: download api artifact from latest npmPublish for testing
iclanton Feb 23, 2026
a4467e5
Use api-documenter-docusaurus-plugin.
iclanton Feb 23, 2026
43b9ba8
fixup! Use api-documenter-docusaurus-plugin.
iclanton Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions common/config/azure-pipelines/bump-decoupled-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
parameters:
- name: delayMinutes
displayName: 'Minutes to wait for packages to propagate before running'
type: number
default: 5

variables:
- name: FORCE_COLOR
value: 1
- name: BranchName
value: 'automated/bump-decoupled-deps'
- name: CommitMessage
value: 'chore: bump decoupled local dependencies'

resources:
pipelines:
- pipeline: npmPublish
source: 'rushstack NPM Publish'
trigger:
branches:
include:
- main
- pipeline: npmPublishRush
source: 'rushstack NPM Publish (rush)'
trigger:
branches:
include:
- main
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
os: windows
stages:
- stage:
jobs:
- job:
pool:
name: publish-rushstack
os: linux
steps:
- checkout: self
persistCredentials: true

- bash: |
echo "Waiting ${{ parameters.delayMinutes }} minute(s) for packages to propagate to npm..."
sleep $(( ${{ parameters.delayMinutes }} * 60 ))
displayName: 'Wait for packages to propagate'

- template: /common/config/azure-pipelines/templates/install-node.yaml@self

- script: 'git config --local user.email rushbot@users.noreply.github.com'
displayName: 'git config email'

- script: 'git config --local user.name Rushbot'
displayName: 'git config name'

- script: 'node common/scripts/install-run-rush.js install'
displayName: 'Rush Install'

- script: 'node common/scripts/install-run-rush.js build --to repo-toolbox --verbose'
displayName: 'Rush Build (repo-toolbox)'

- script: 'node repo-scripts/repo-toolbox/lib-commonjs/start.js bump-decoupled-local-dependencies'
displayName: 'Bump decoupled local dependencies'

- script: 'node common/scripts/install-run-rush.js update'
displayName: 'Rush Update'

- bash: |
set -e

if git diff --quiet; then
echo "No changes detected. Skipping commit and PR."
echo "##vso[task.setvariable variable=HasChanges]false"
exit 0
fi

echo "##vso[task.setvariable variable=HasChanges]true"

git checkout -B $(BranchName)
git add --all
git commit -m "$(CommitMessage)"
displayName: 'Commit dependency changes'

- bash: |
set -e

node common/scripts/install-run-rush.js change \
--bulk \
--bump-type none \
--commit-message "chore: generate change files for decoupled dependency bump"
displayName: 'Generate change files'
condition: and(succeeded(), eq(variables.HasChanges, 'true'))

- template: /common/config/azure-pipelines/templates/push-and-create-github-pr.yaml@self
parameters:
BranchName: $(BranchName)
PrTitle: $(CommitMessage)
PrDescription: 'Automated PR to bump decoupled local dependencies to the latest published versions.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
parameters:
- name: BranchName
type: string
- name: PrTitle
type: string
- name: PrDescription
type: string
default: ''
- name: TargetBranch
type: string
default: 'main'
- name: HasChangesVariableName
type: string
default: 'HasChanges'

steps:
- bash: |
set -e
git push origin ${{ parameters.BranchName }} --force
Comment thread
iclanton marked this conversation as resolved.
displayName: 'Push branch'
condition: and(succeeded(), eq(variables['${{ parameters.HasChangesVariableName }}'], 'true'))

- bash: |
Comment thread
iclanton marked this conversation as resolved.
set -e

# Derive owner/repo from the git remote
REPO_SLUG=$(git remote get-url origin | sed -E 's#.*github\.com[:/](.+/[^.]+)(\.git)?$#\1#')
echo "Repository: ${REPO_SLUG}"

# Extract the authorization header that AzDO configured via persistCredentials
AUTH_HEADER=$(git config --get-regexp 'http\..*\.extraheader' | head -1 | sed 's/^[^ ]* //')
if [ -z "$AUTH_HEADER" ]; then
echo "##[error]Could not extract authorization header from git config. Ensure persistCredentials is enabled on the checkout step."
exit 1
fi

PR_TITLE="${{ parameters.PrTitle }}"
PR_BODY="${{ parameters.PrDescription }}"
API_BASE="https://api.github.com/repos/${REPO_SLUG}"

# Helper to call the GitHub API and fail with a visible error
github_api() {
local RESPONSE HTTP_CODE
RESPONSE=$(curl -s -w "\n%{http_code}" "$@")
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
BODY=$(echo "$RESPONSE" | sed '$d')

if [[ "$HTTP_CODE" -ge 200 && "$HTTP_CODE" -lt 300 ]]; then
echo "$BODY"
else
echo "::error::GitHub API returned HTTP ${HTTP_CODE}:" >&2
echo "$BODY" >&2
return 1
fi
}

# Check if a PR already exists for this branch
OWNER=$(echo "${REPO_SLUG}" | cut -d/ -f1)
EXISTING_PR=$(github_api \
-H "$AUTH_HEADER" \
-H "Accept: application/vnd.github+json" \
"${API_BASE}/pulls?head=${OWNER}:${{ parameters.BranchName }}&state=open" \
| jq '.[0].number // empty')
Comment thread
iclanton marked this conversation as resolved.

if [ -n "$EXISTING_PR" ]; then
echo "Updating existing PR #${EXISTING_PR}"
github_api -X PATCH \
-H "$AUTH_HEADER" \
-H "Accept: application/vnd.github+json" \
"${API_BASE}/pulls/${EXISTING_PR}" \
-d "$(jq -n --arg body "$PR_BODY" '{body: $body}')"
else
echo "Creating new PR"
github_api -X POST \
-H "$AUTH_HEADER" \
Comment thread
iclanton marked this conversation as resolved.
Outdated
-H "Accept: application/vnd.github+json" \
"${API_BASE}/pulls" \
-d "$(jq -n \
--arg title "$PR_TITLE" \
Comment thread
iclanton marked this conversation as resolved.
--arg body "$PR_BODY" \
--arg head "${{ parameters.BranchName }}" \
--arg base "${{ parameters.TargetBranch }}" \
'{title: $title, body: $body, head: $head, base: $base}')"
fi
displayName: 'Create or update GitHub PR'
condition: and(succeeded(), eq(variables['${{ parameters.HasChangesVariableName }}'], 'true'))