forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'github:main' into main
- Loading branch information
Showing
2,666 changed files
with
2,090,861 additions
and
420,258 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Install CocoFix | ||
|
||
description: Installs the private package `@github/cocofix` from the GitHub Package Registry. | ||
|
||
inputs: | ||
token: | ||
description: PAT | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install CoCoFix | ||
shell: bash | ||
env: | ||
TOKEN: ${{ inputs.token }} | ||
run: | | ||
npm install --no-save \ | ||
'--@github:registry=https://npm.pkg.github.com' \ | ||
'--//npm.pkg.github.com/:_authToken=${TOKEN}' \ | ||
@github/cocofix |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Branch Protection Settings | ||
|
||
This directory is mean to store a dump of the branch protections rules we have set in this repo. They are used by a workflow to compare against what is actually in settings in order to alert to changes. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{ | ||
"url": "https://api.github.com/repos/github/docs-internal/branches/main/protection", | ||
"required_status_checks": { | ||
"url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/required_status_checks", | ||
"strict": true, | ||
"contexts": [ | ||
"Build and deploy Azure preview environment", | ||
"automated-pipelines", | ||
"github-apps", | ||
"graphql", | ||
"events", | ||
"landings", | ||
"rest", | ||
"search", | ||
"webhooks", | ||
"local-dev", | ||
"check-links", | ||
"shielding", | ||
"observability", | ||
"pageinfo", | ||
"redirects", | ||
"ghes-releases", | ||
"content-render", | ||
"assets", | ||
"languages", | ||
"learning-track", | ||
"release-notes", | ||
"color-schemes", | ||
"content-linter", | ||
"lint-content", | ||
"playwright-tests (playwright-rendering)", | ||
"archives", | ||
"versions", | ||
"audit-logs", | ||
"changelogs", | ||
"data-directory", | ||
"early-access", | ||
"fixtures", | ||
"frame", | ||
"products", | ||
"workflows" | ||
], | ||
"contexts_url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/required_status_checks/contexts", | ||
"checks": [ | ||
{ | ||
"context": "Build and deploy Azure preview environment", | ||
"app_id": 15368 | ||
}, | ||
{ "context": "automated-pipelines", "app_id": 15368 }, | ||
{ "context": "github-apps", "app_id": 15368 }, | ||
{ "context": "graphql", "app_id": 15368 }, | ||
{ "context": "events", "app_id": 15368 }, | ||
{ "context": "landings", "app_id": 15368 }, | ||
{ "context": "rest", "app_id": 15368 }, | ||
{ "context": "search", "app_id": 15368 }, | ||
{ "context": "webhooks", "app_id": 15368 }, | ||
{ "context": "local-dev", "app_id": 15368 }, | ||
{ "context": "check-links", "app_id": 15368 }, | ||
{ "context": "shielding", "app_id": 15368 }, | ||
{ "context": "observability", "app_id": 15368 }, | ||
{ "context": "pageinfo", "app_id": 15368 }, | ||
{ "context": "redirects", "app_id": 15368 }, | ||
{ "context": "ghes-releases", "app_id": 15368 }, | ||
{ "context": "content-render", "app_id": 15368 }, | ||
{ "context": "assets", "app_id": 15368 }, | ||
{ "context": "languages", "app_id": 15368 }, | ||
{ "context": "learning-track", "app_id": 15368 }, | ||
{ "context": "release-notes", "app_id": 15368 }, | ||
{ "context": "color-schemes", "app_id": 15368 }, | ||
{ "context": "content-linter", "app_id": 15368 }, | ||
{ "context": "lint-content", "app_id": 15368 }, | ||
{ "context": "playwright-tests (playwright-rendering)", "app_id": 15368 }, | ||
{ "context": "archives", "app_id": 15368 }, | ||
{ "context": "versions", "app_id": 15368 }, | ||
{ "context": "audit-logs", "app_id": 15368 }, | ||
{ "context": "changelogs", "app_id": 15368 }, | ||
{ "context": "data-directory", "app_id": 15368 }, | ||
{ "context": "early-access", "app_id": 15368 }, | ||
{ "context": "fixtures", "app_id": 15368 }, | ||
{ "context": "frame", "app_id": 15368 }, | ||
{ "context": "products", "app_id": 15368 }, | ||
{ "context": "workflows", "app_id": 15368 } | ||
] | ||
}, | ||
"restrictions": { | ||
"url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/restrictions", | ||
"users_url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/restrictions/users", | ||
"teams_url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/restrictions/teams", | ||
"apps_url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/restrictions/apps", | ||
"users": [], | ||
"teams": [ | ||
{ | ||
"name": "docs", | ||
"id": 325922, | ||
"node_id": "MDQ6VGVhbTMyNTkyMg==", | ||
"slug": "docs", | ||
"description": "We're the Docs Team! We work in /docs and /docs-internal and publish docs.github.com. ", | ||
"privacy": "closed", | ||
"notification_setting": "notifications_enabled", | ||
"url": "https://api.github.com/organizations/9919/team/325922", | ||
"html_url": "https://github.com/orgs/github/teams/docs", | ||
"members_url": "https://api.github.com/organizations/9919/team/325922/members{/member}", | ||
"repositories_url": "https://api.github.com/organizations/9919/team/325922/repos", | ||
"permission": "pull", | ||
"parent": null | ||
} | ||
], | ||
"apps": [] | ||
}, | ||
"required_pull_request_reviews": { | ||
"url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/required_pull_request_reviews", | ||
"dismiss_stale_reviews": false, | ||
"require_code_owner_reviews": true, | ||
"require_last_push_approval": false, | ||
"required_approving_review_count": 1, | ||
"dismissal_restrictions": { | ||
"url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/dismissal_restrictions", | ||
"users_url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/dismissal_restrictions/users", | ||
"teams_url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/dismissal_restrictions/teams", | ||
"users": [], | ||
"teams": [], | ||
"apps": [] | ||
} | ||
}, | ||
"required_signatures": { | ||
"url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/required_signatures", | ||
"enabled": false | ||
}, | ||
"enforce_admins": { | ||
"url": "https://api.github.com/repos/github/docs-internal/branches/main/protection/enforce_admins", | ||
"enabled": false | ||
}, | ||
"required_linear_history": { "enabled": false }, | ||
"allow_force_pushes": { "enabled": false }, | ||
"allow_deletions": { "enabled": false }, | ||
"block_creations": { "enabled": true }, | ||
"required_conversation_resolution": { "enabled": false }, | ||
"lock_branch": { "enabled": false }, | ||
"allow_fork_syncing": { "enabled": false } | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Alert Changed Branch Protections | ||
|
||
on: | ||
branch_protection_rule: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-branch-protections: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'github/docs-internal' | ||
|
||
strategy: | ||
matrix: | ||
# List of branches we want to monitor for protection changes | ||
branch: [main] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Fetch branch protections | ||
id: fetch | ||
env: | ||
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }} | ||
run: | | ||
# Fetch branch protections and store them in a file | ||
gh api /repos/GitHub/docs-internal/branches/${{ matrix.branch }}/protection > ${{ matrix.branch }}-actual.json | ||
- name: Format fetched settings with prettier for comparison | ||
id: format | ||
run: | | ||
npx prettier --write ${{ matrix.branch }}-actual.json | ||
- name: Compare branch protections | ||
id: compare | ||
run: | | ||
# Compare the fetched branch protections with the committed ones | ||
git diff --no-index .github/branch_protection_settings/${{ matrix.branch }}.json ${{ matrix.branch }}-actual.json | ||
- uses: ./.github/actions/slack-alert | ||
if: ${{ failure() && github.event_name != 'workflow_dispatch' }} | ||
with: | ||
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} | ||
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} |
Oops, something went wrong.