Skip to content

Commit d7df63e

Browse files
authored
Merge pull request #36989 from github/repo-sync
Repo sync
2 parents 02599c8 + 0338776 commit d7df63e

33 files changed

+9748
-277
lines changed

.github/actions/get-changed-files/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Get changed files
22
description: Get a list of changed files
33

44
inputs:
5-
file_filter:
5+
files:
66
description: 'Files or directories to check for changes, supports names, directories, trailing slashes, and single trailing wildcard'
77
required: false
88
default: '.'

.github/actions/get-changed-files/get-changed-files.sh

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,23 @@ if [ -z "$DIFF" ]; then
3131
echo "__ using branch name $INPUT_HEAD __"
3232
git fetch origin main --depth 1
3333
echo "__ running git diff __"
34-
DIFF=$(git diff --name-only origin/main $INPUT_HEAD)
34+
35+
temp_file=$(mktemp)
36+
git diff --name-only origin/main $INPUT_HEAD > "$temp_file" 2>/dev/null
37+
GIT_EXIT_CODE=$?
38+
39+
DIFF=$(cat "$temp_file")
40+
rm -f "$temp_file"
41+
42+
if [ $GIT_EXIT_CODE -ne 0 ]; then
43+
echo "__ git diff failed with exit code $GIT_EXIT_CODE, fetching unshallow __"
44+
git fetch --depth=100 origin $INPUT_HEAD
45+
git diff --name-only origin/main $INPUT_HEAD > "$temp_file" 2>/dev/null
46+
DIFF=$(cat "$temp_file")
47+
rm -f "$temp_file"
48+
else
49+
echo "__ git diff succeeded __"
50+
fi
3551
fi
3652

3753
# So we can inspect the output
@@ -58,23 +74,25 @@ if [ "$FILTER" != "." ]; then
5874
echo "$DIFF"
5975
fi
6076

61-
# Format the output
6277
echo "__ formatting output __"
63-
FORMATTED_DIFF=$(echo $DIFF | tr '\n' ' ' | tr -s ' ')
64-
echo "$FORMATTED_DIFF"
78+
FORMATTED_DIFF=$(echo "$DIFF" | tr '\n' ' ' | tr -s ' ' | sed 's/^ *//' | sed 's/ *$//')
79+
echo "Formatted diff: '$FORMATTED_DIFF'"
6580

6681
# Set the output for GitHub Actions
67-
if [[ -n "$GITHUB_OUTPUT" ]]; then
68-
ALL_FORMATTED=$(echo "$DIFF" | tr '\n' ' ' | tr -s ' ')
69-
echo "all_changed_files=$ALL_FORMATTED" >> "$GITHUB_OUTPUT"
70-
echo "filtered_changed_files=$FORMATTED_DIFF" >> "$GITHUB_OUTPUT"
71-
else
72-
echo "all_changed_files=$DIFF"
73-
echo "filtered_changed_files=$FORMATTED_DIFF"
74-
fi
75-
76-
# If output file is specified, write the filtered changes to it
7782
if [[ -n "$INPUT_OUTPUT_FILE" ]]; then
78-
echo "$FORMATTED_DIFF" > "$INPUT_OUTPUT_FILE"
79-
echo "__ wrote changes to $INPUT_OUTPUT_FILE __"
83+
ALL_FORMATTED=$(echo "$DIFF" | tr '\n' ' ' | tr -s ' ' | sed 's/^ *//' | sed 's/ *$//')
84+
85+
# Only set outputs if there are actually changed files
86+
if [[ -z "$ALL_FORMATTED" ]]; then
87+
echo "No changed files detected, setting empty outputs"
88+
echo "all_changed_files=" >> "$INPUT_OUTPUT_FILE"
89+
echo "filtered_changed_files=" >> "$INPUT_OUTPUT_FILE"
90+
else
91+
echo "Setting non-empty outputs"
92+
echo "all_changed_files=$ALL_FORMATTED" >> "$INPUT_OUTPUT_FILE"
93+
echo "filtered_changed_files=$FORMATTED_DIFF" >> "$INPUT_OUTPUT_FILE"
94+
fi
95+
else
96+
echo "all_changed_files='$DIFF'"
97+
echo "filtered_changed_files='$FORMATTED_DIFF'"
8098
fi

.github/workflows/content-lint-markdown.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
steps:
2525
- name: Check out repo
2626
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27-
with:
28-
fetch-depth: 10
2927

3028
- name: Set up Node and dependencies
3129
uses: ./.github/actions/node-npm-setup

.github/workflows/first-responder-v2-prs-collect.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,6 @@ jobs:
6565
run: |
6666
gh pr edit $PR_URL --add-label docs-content-fr
6767
68-
# Check if the PR is connected to an issue that has the DIY docs label. If yes, then add the DIY docs label to the PR.
69-
- name: Check if PR is connected to DIY docs issue
70-
id: check-diy-docs
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
73-
run: |
74-
ISSUE_NUMS=$(echo "${{ github.event.pull_request.body }}" | grep -oE '(https://github.com/github/docs-content/issues/[0-9]+|#[0-9]+)' | grep -oE '[0-9]+')
75-
for ISSUE_NUM in $ISSUE_NUMS; do
76-
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name')
77-
if echo "$LABELS" | grep -q 'DIY docs'; then
78-
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
79-
break
80-
fi
81-
done
82-
83-
- name: Add the DIY docs label if connected to a DIY docs issue
84-
if: ${{ env.DIY_DOCS_LABEL == 'true' }}
85-
env:
86-
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
87-
PR_URL: ${{ github.event.pull_request.html_url }}
88-
run: |
89-
gh pr edit $PR_URL --add-label 'DIY docs'
90-
9168
# Add to the FR project
9269
# and set type to "Maintenance" or "External contributor PR"
9370
# and set date to now

.github/workflows/ready-for-doc-review.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Ready for docs-content review
22

3-
# **What it does**: Adds pull requests in the docs-internal repository to the docs-content review board when the "ready-for-doc-review" label is added or when a review by docs-content or docs-reviewers is requested. This workflow is also called as a reusable workflow from other repos including docs-content, docs-strategy, docs-early-access, and github.
3+
# **What it does**: Adds pull requests in the docs-internal repository to the docs-content review board when the "ready-for-doc-review" label is added or when a review by docs-content or docs-reviewers is requested. Adds the "DIY docs" label to the PR if it is connected to a DIY docs issue in the docs-content repo. This workflow is also called as a reusable workflow from other repos including docs-content, docs-strategy, docs-early-access, and github.
44
# **Why we have it**: So that other GitHub teams can easily request reviews from the docs-content team, and so that writers can see when a PR is ready for review
55
# **Who does it impact**: Writers who need to review docs-related PRs
66

@@ -43,6 +43,41 @@ jobs:
4343
echo "AUTHOR_LOGIN=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
4444
fi
4545
46+
# Check if the PR is connected to an issue that has the DIY docs label. The grep command parses through the PR description to find issue numbers that are linked in the PR description. The GitHub CLI command then checks if the issue exists in the docs-content repo, then checks if the linked docs-content issues have the DIY docs label. If the linked issues have the DIY docs label, the DIY_DOCS_LABEL environment variable is set to true.
47+
- name: Check if PR is connected to DIY docs issue
48+
id: check-diy-docs
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
51+
run: |
52+
ISSUE_NUMS=$(echo "${{ github.event.pull_request.body }}" | grep -oE '(https://github.com/github/docs-content/issues/[0-9]+|github/docs-content#[0-9]+|#[0-9]+)' | grep -oE '[0-9]+$')
53+
54+
if [ -n "$ISSUE_NUMS" ]; then
55+
for ISSUE_NUM in $ISSUE_NUMS; do
56+
# Check if the issue exists in the docs-content repository
57+
if gh issue view $ISSUE_NUM --repo github/docs-content --json labels > /dev/null 2>&1; then
58+
# Fetch labels for the issue
59+
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name' || echo "")
60+
if echo "$LABELS" | grep -q 'DIY docs'; then
61+
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
62+
break
63+
fi
64+
else
65+
echo "Issue $ISSUE_NUM does not exist in the docs-content repository."
66+
fi
67+
done
68+
else
69+
echo "No DIY docs issues found in the PR description."
70+
fi
71+
72+
# If the PR description contains a link to a DIY docs issue, add the DIY docs label to the PR.
73+
- name: Add the DIY docs label if connected to a DIY docs issue
74+
if: ${{ env.DIY_DOCS_LABEL == 'true' }}
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
77+
PR_URL: ${{ github.event.pull_request.html_url }}
78+
run: |
79+
gh pr edit $PR_URL --add-label 'DIY docs'
80+
4681
- name: Run script
4782
run: |
4883
npm run ready-for-docs-review

.github/workflows/reviewers-legal.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,23 @@ jobs:
3333
steps:
3434
- name: Check out repo
3535
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
36-
with:
37-
# Picking this number is a "best guess". If we make it too large,
38-
# the checkout will take potentially unnecessarily long.
39-
# This reduces the chance that tj-actions/changed-files has to
40-
# fetch deeper history. But if it needs to, it will.
41-
fetch-depth: 10
4236

4337
- name: Get changed files
44-
id: changed-files
45-
uses: tj-actions/changed-files@40853de9f8ce2d6cfdc73c1b96f14e22ba44aec4 # v45.0.0
38+
id: changed_files
39+
uses: ./.github/actions/get-changed-files
4640
with:
4741
files: 'content/**'
48-
output_renamed_files_as_deleted_and_added: true
4942

5043
- name: Set up Node and dependencies
51-
if: steps.changed-files.outputs.any_changed == 'true'
44+
if: steps.changed_files.outputs.filtered_changed_files
5245
uses: ./.github/actions/node-npm-setup
5346

5447
- name: Check content type
55-
if: steps.changed-files.outputs.any_changed == 'true'
48+
if: steps.changed_files.outputs.filtered_changed_files
5649
id: checkContentType
5750
run: npm run check-content-type
5851
env:
59-
# all_changed_files does not include deleted files
60-
CHANGED_FILE_PATHS: ${{ steps.changed-files.outputs.all_changed_files }}
52+
CHANGED_FILE_PATHS: ${{ steps.changed_files.outputs.filtered_changed_files }}
6153
CONTENT_TYPE: 'rai'
6254

6355
- name: Check for reviewers-legal label, add if missing and request review
202 KB
Loading

config/moda/deployment.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ environments:
1818
cluster_selector:
1919
profile: general
2020
region: iad
21-
extra_completed_message: Review at https://docs-internal-staging-boxwood.githubapp.com/
21+
extra_completed_message: ':boxwood: Review at https://docs-internal-staging-boxwood.githubapp.com/'
2222

2323
- name: staging-cedar
2424
require_pipeline: false
@@ -29,7 +29,7 @@ environments:
2929
cluster_selector:
3030
profile: general
3131
region: iad
32-
extra_completed_message: Review at https://docs-internal-staging-cedar.githubapp.com/
32+
extra_completed_message: ':cedar: Review at https://docs-internal-staging-cedar.githubapp.com/'
3333

3434
- name: staging-cypress
3535
require_pipeline: false
@@ -40,7 +40,7 @@ environments:
4040
cluster_selector:
4141
profile: general
4242
region: iad
43-
extra_completed_message: Review at https://docs-internal-staging-cypress.githubapp.com/
43+
extra_completed_message: ':cypress: Review at https://docs-internal-staging-cypress.githubapp.com/'
4444

4545
- name: staging-fir
4646
require_pipeline: false
@@ -51,7 +51,7 @@ environments:
5151
cluster_selector:
5252
profile: general
5353
region: iad
54-
extra_completed_message: Review at https://docs-internal-staging-fir.githubapp.com/
54+
extra_completed_message: ':fir: Review at https://docs-internal-staging-fir.githubapp.com/'
5555

5656
- name: staging-hemlock
5757
require_pipeline: false
@@ -62,7 +62,7 @@ environments:
6262
cluster_selector:
6363
profile: general
6464
region: iad
65-
extra_completed_message: Review at https://docs-internal-staging-hemlock.githubapp.com/
65+
extra_completed_message: ':hemlock: Review at https://docs-internal-staging-hemlock.githubapp.com/'
6666

6767
- name: staging-holly
6868
require_pipeline: false
@@ -73,7 +73,7 @@ environments:
7373
cluster_selector:
7474
profile: general
7575
region: iad
76-
extra_completed_message: Review at https://docs-internal-staging-holly.githubapp.com/
76+
extra_completed_message: ':holly_: Review at https://docs-internal-staging-holly.githubapp.com/'
7777

7878
- name: staging-juniper
7979
require_pipeline: false
@@ -84,7 +84,7 @@ environments:
8484
cluster_selector:
8585
profile: general
8686
region: iad
87-
extra_completed_message: Review at https://docs-internal-staging-juniper.githubapp.com/
87+
extra_completed_message: ':juniper: Review at https://docs-internal-staging-juniper.githubapp.com/'
8888

8989
- name: staging-laurel
9090
require_pipeline: false
@@ -95,7 +95,7 @@ environments:
9595
cluster_selector:
9696
profile: general
9797
region: iad
98-
extra_completed_message: Review at https://docs-internal-staging-laurel.githubapp.com/
98+
extra_completed_message: ':laurel: Review at https://docs-internal-staging-laurel.githubapp.com/'
9999

100100
- name: staging-pine
101101
require_pipeline: false
@@ -106,7 +106,7 @@ environments:
106106
cluster_selector:
107107
profile: general
108108
region: iad
109-
extra_completed_message: Review at https://docs-internal-staging-pine.githubapp.com/
109+
extra_completed_message: ':pine: Review at https://docs-internal-staging-pine.githubapp.com/'
110110

111111
- name: staging-redwood
112112
require_pipeline: false
@@ -117,7 +117,7 @@ environments:
117117
cluster_selector:
118118
profile: general
119119
region: iad
120-
extra_completed_message: Review at https://docs-internal-staging-redwood.githubapp.com/
120+
extra_completed_message: ':redwood: Review at https://docs-internal-staging-redwood.githubapp.com/'
121121

122122
- name: staging-sequoia
123123
require_pipeline: false
@@ -128,7 +128,7 @@ environments:
128128
cluster_selector:
129129
profile: general
130130
region: iad
131-
extra_completed_message: Review at https://docs-internal-staging-sequoia.githubapp.com/
131+
extra_completed_message: ':sequoia: Review at https://docs-internal-staging-sequoia.githubapp.com/'
132132

133133
- name: staging-spruce
134134
require_pipeline: false
@@ -139,7 +139,7 @@ environments:
139139
cluster_selector:
140140
profile: general
141141
region: iad
142-
extra_completed_message: Review at https://docs-internal-staging-spruce.githubapp.com/
142+
extra_completed_message: ':spruce: Review at https://docs-internal-staging-spruce.githubapp.com/'
143143

144144
required_builds:
145145
- docs-internal-moda-config-bundle / docs-internal-moda-config-bundle

content/billing/using-the-new-billing-platform/preventing-overspending.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ Budgets and alerts allow you to track spending for your {% ifversion fpt %}organ
1818

1919
The budget only applies to expenses incurred from the date of its creation onwards. Any expenses incurred prior to the creation of the budget will not be included in the calculations
2020

21-
Budgets are not applicable to:
21+
{% ifversion ghec %}
22+
Budgets are not applicable to pre-paid volume licenses.
23+
{% endif %}
2224

23-
* {% ifversion enterprise-licensing-language %}License{% else %}Seat{% endif %}-based products such as {% data variables.product.prodname_copilot %}{% ifversion fpt %} and {% data variables.product.prodname_team %}{% elsif ghec %}, {% data variables.product.prodname_GH_advanced_security %}, and {% data variables.product.prodname_enterprise %}.
24-
* Pre-paid volume licenses{% endif %}.
25+
For license-based products such as {% data variables.product.prodname_copilot %}{% ifversion fpt %} and {% data variables.product.prodname_team %}{% elsif ghec %}, {% data variables.product.prodname_GH_advanced_security %}, and {% data variables.product.prodname_enterprise %}{% endif %}, setting a budget does not prevent usage over the limit.
2526

2627
> [!NOTE]
2728
> By default, paid usage will be limited to $0 for accounts that do not have a payment method on file. For accounts that do have a payment method on file, the default budget is unlimited.

content/code-security/adopting-github-advanced-security-at-scale/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Adopting GitHub Advanced Security at scale
2+
title: 'Adopting {% data variables.product.prodname_GHAS %} at scale'
33
shortTitle: Adopt GHAS at scale
4-
intro: A phased approach to rolling out GitHub Advanced Security at your company using industry and GitHub best practices.
4+
intro: A phased approach to rolling out {% data variables.product.prodname_GHAS %} at your company using industry and GitHub best practices.
55
versions:
66
ghes: '*'
77
ghec: '*'

0 commit comments

Comments
 (0)