Skip to content

Conversation

@michaeltlombardi
Copy link
Contributor

PR Summary

This PR adds a new GitHub Action workflow to validate that the author of a PR can target the live branch. It runs whenever a PR targeting the live branch is opened, reopened, or synchronized (new commits are pushed or the branch is forcibly updated).

It checks the collaborators of the repository for the PR author to see if they have permissions as a maintainer or administrator; no other users are authorized to target changes at the live branch.

If the author does not have the correct permissions, the check fails. With the branch protections for the repository set to require this check when targeting live, this will prevent unauthorized collaborators from accidentally trying to merge their changes to the live site instead of the working branch.

PR Context

Check the boxes below to indicate the content affected by this PR.

Repository or docset configuration

  • Repo documentation and configuration (.git/.github/.vscode etc.)
  • Docs build files (.openpublishing.* and build scripts)
  • Docset configuration (docfx.json, mapping, bread, module folder)

Conceptual documentation

  • Files in docs-conceptual

Cmdlet reference & about_ topics
When changing cmdlet reference or about_ topics, the changes should be copied to all
relevant versions. Check the boxes below to indicate the versions affected by this change.

  • Preview content
  • Version 7.2 content
  • Version 7.1 content
  • Version 7.0 content
  • Version 5.1 content

PR Checklist

  • I have read the contributors guide and followed the style and process guidelines
  • PR has a meaningful title
  • PR is targeted at the staging branch
  • All relevant versions updated
  • Includes content related to issues and PRs - see Closing issues using keywords.
  • This PR is ready to merge and is not Work in Progress. If the PR is work in progress,
    please add the prefix WIP: or [WIP] to the beginning of the title and remove the prefix when
    the PR is ready.

This commit adds a new GitHub Action workflow to validate that the
author of a PR can target the `live` branch. It runs whenever a PR
targeting the `live` branch is opened, reopened, or synchronized (new
commits are pushed or the branch is forcibly updated).

It checks the collaborators of the repository for the PR author to see
if they have permissions as a maintainer or administrator; no other
users are authorized to target changes at the `live` branch.

If the author does not have the correct permissions, the check fails.
With the branch protections for the repository set to require this check
when targeting `live`, this will prevent unauthorized collaborators from
accidentally trying to merge their changes to the live site instead of
the working branch.
@opbld33
Copy link

opbld33 commented Apr 1, 2022

Docs Build status updates of commit 2ded70b:

✅ Validation status: passed

File Status Preview URL Details
.github/workflows/targeting-valid-branch.yml ✅Succeeded

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@sdwheeler sdwheeler merged commit 5bda02b into MicrosoftDocs:staging Apr 1, 2022
@michaeltlombardi michaeltlombardi deleted the maint/staging/add-valid-branch-check branch May 5, 2022 17:32
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.

3 participants