Skip to content

[EngSys] Restrict docs release jobs to public repo only#6960

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-docs-release-jobs
Open

[EngSys] Restrict docs release jobs to public repo only#6960
Copilot wants to merge 4 commits intomainfrom
copilot/fix-docs-release-jobs

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Pull Request Checklist

  • C++ Guidelines
  • Doxygen docs
  • Unit tests
  • No unwanted commits/changes
  • Descriptive title/description
    • PR is single purpose
    • Related issue listed
  • Comments in source
  • No typos
  • Update changelog
  • Not work-in-progress
  • External references or docs updated
  • Self review of PR done
  • Any breaking changes?

Description

Docs publishing jobs (github.io, docs.ms) were running from both public and PR repos. Added condition ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr') to gate execution to public repo only.

Changes

  • eng/pipelines/templates/stages/archetype-cpp-release.yml: Added condition to PublishDocs job (github.io publishing) and PublishDocsMs job (docs.ms/learn.microsoft.com publishing)

Condition format aligns with other Azure SDK repos for consistency.

Note: Initial changes to eng/common/pipelines/templates/jobs/docindex.yml and eng/pipelines/docindex.yml were reverted as those pipelines don't run in the -pr repo.

Original prompt

This section details on the original issue you should resolve

<issue_title>[EngSys] Docs release jobs should only run if executed from public repo</issue_title>
<issue_description>Docs release jobs (e.g. update docs.ms metadata, publish to github.io docs) should only run when the pipeline is being executed from a public repo (i.e. repo name does not have -pr in the suffix).

After reviewing use of similar clauses in other repos, let's use this construction for the condition:

ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr')

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 18, 2026 00:40
- Add condition to PublishDocs job to skip when running from PR repo
- Add condition to PublishDocsMs job to skip when running from PR repo
- Add condition to CreateDocIndex job to skip when running from PR repo
- Uses ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr') as specified in the issue

Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
This job updates docs.ms build configuration and should only run from public repo

Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix docs release jobs to run only for public repos [EngSys] Restrict docs release jobs to public repo only Feb 18, 2026
Copilot AI requested a review from danieljurek February 18, 2026 00:42
These files don't need the condition as they'll never run in the -pr repo

Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
@danieljurek danieljurek marked this pull request as ready for review February 18, 2026 06:34
Copilot AI review requested due to automatic review settings February 18, 2026 06:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restricts documentation publishing jobs to run only in the public repository (Azure/azure-sdk-for-cpp) and prevents them from running in the PR repository (Azure/azure-sdk-for-cpp-pr). This ensures that documentation releases to GitHub Pages and docs.ms/learn.microsoft.com only occur from the official public repository, avoiding duplicate or unwanted publishes from the PR repository.

Changes:

  • Added repository name check conditions to PublishDocs and PublishDocsMs jobs to gate execution to the public repo only
  • Both jobs now include ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr') in their condition clauses

- job: PublishDocs
displayName: Publish Docs to GitHub pages
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr'))
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository name check pattern used here differs from the existing pattern on line 20 of this file. Line 20 uses not(endsWith(variables['Build.Repository.Name'], '-pr')) which is more generic, while this uses an exact match for 'Azure/azure-sdk-for-cpp-pr'.

While the PR description mentions this aligns with other Azure SDK repos, having two different patterns in the same file reduces maintainability. Consider either:

  1. Using the same endsWith pattern as line 20 for consistency within this file
  2. Documenting why the exact match is preferred for job-level conditions (if there's a specific reason)

The endsWith approach would also be more maintainable if repository names change in the future.

Suggested change
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr'))
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), not(endsWith(variables['Build.Repository.Name'], '-pr')))

Copilot uses AI. Check for mistakes.
- job: PublishDocsMs
displayName: Docs.MS Release
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-cpp-pr'))
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository name check pattern used here differs from the existing pattern on line 20 of this file. Line 20 uses not(endsWith(variables['Build.Repository.Name'], '-pr')) which is more generic, while this uses an exact match for 'Azure/azure-sdk-for-cpp-pr'.

While the PR description mentions this aligns with other Azure SDK repos, having two different patterns in the same file reduces maintainability. Consider either:

  1. Using the same endsWith pattern as line 20 for consistency within this file
  2. Documenting why the exact match is preferred for job-level conditions (if there's a specific reason)

The endsWith approach would also be more maintainable if repository names change in the future.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EngSys] Docs release jobs should only run if executed from public repo

2 participants