Skip to content

Commit 7772479

Browse files
committed
Merge branch 'main' into choose-ai-model
# Conflicts: # content/copilot/using-github-copilot/ai-models/changing-the-ai-model-for-copilot-chat.md # content/copilot/using-github-copilot/ai-models/using-claude-sonnet-in-github-copilot.md # content/copilot/using-github-copilot/ai-models/using-gemini-flash-in-github-copilot.md
2 parents 42e3c00 + 33b20c0 commit 7772479

File tree

3,002 files changed

+1050823
-907480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,002 files changed

+1050823
-907480
lines changed

.github/actions/clone-translations/action.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ inputs:
1010
runs:
1111
using: 'composite'
1212
steps:
13-
- name: Clone Simplified Chinese
13+
- name: Clone Spanish
1414
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1515
with:
16-
repository: github/docs-internal.zh-cn
16+
repository: github/docs-internal.es-es
1717
token: ${{ inputs.token }}
18-
path: translations/zh-cn
18+
path: translations/es-es
1919

20-
- name: Clone Spanish
20+
- name: Clone Japanese
2121
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2222
with:
23-
repository: github/docs-internal.es-es
23+
repository: github/docs-internal.ja-jp
2424
token: ${{ inputs.token }}
25-
path: translations/es-es
25+
path: translations/ja-jp
2626

2727
- name: Clone Portuguese
2828
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -31,19 +31,19 @@ runs:
3131
token: ${{ inputs.token }}
3232
path: translations/pt-br
3333

34-
- name: Clone Russian
34+
- name: Clone Simplified Chinese
3535
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3636
with:
37-
repository: github/docs-internal.ru-ru
37+
repository: github/docs-internal.zh-cn
3838
token: ${{ inputs.token }}
39-
path: translations/ru-ru
39+
path: translations/zh-cn
4040

41-
- name: Clone Japanese
41+
- name: Clone Russian
4242
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4343
with:
44-
repository: github/docs-internal.ja-jp
44+
repository: github/docs-internal.ru-ru
4545
token: ${{ inputs.token }}
46-
path: translations/ja-jp
46+
path: translations/ru-ru
4747

4848
- name: Clone French
4949
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -52,16 +52,16 @@ runs:
5252
token: ${{ inputs.token }}
5353
path: translations/fr-fr
5454

55-
- name: Clone German
55+
- name: Clone Korean
5656
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5757
with:
58-
repository: github/docs-internal.de-de
58+
repository: github/docs-internal.ko-kr
5959
token: ${{ inputs.token }}
60-
path: translations/de-de
60+
path: translations/ko-kr
6161

62-
- name: Clone Korean
62+
- name: Clone German
6363
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6464
with:
65-
repository: github/docs-internal.ko-kr
65+
repository: github/docs-internal.de-de
6666
token: ${{ inputs.token }}
67-
path: translations/ko-kr
67+
path: translations/de-de
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Get changed files
2+
description: Get a list of changed files
3+
4+
inputs:
5+
files:
6+
description: 'Files or directories to check for changes, supports names, directories, trailing slashes, and single trailing wildcard'
7+
required: false
8+
default: '.'
9+
head:
10+
description: 'Head ref to check for changes against'
11+
required: false
12+
output_file:
13+
description: 'Optional file path to write the changes to'
14+
required: false
15+
16+
outputs:
17+
all_changed_files:
18+
description: 'List of all changed files (unfiltered), includes removals'
19+
value: ${{ steps.get_changes.outputs.all_changed_files }}
20+
filtered_changed_files:
21+
description: 'List of changed files matching the `files` filter, does not include removals'
22+
value: ${{ steps.get_changes.outputs.filtered_changed_files }}
23+
filtered_deleted_files:
24+
description: 'List of deleted files matching the `files` filter'
25+
value: ${{ steps.get_changes.outputs.filtered_deleted_files }}
26+
filtered_renamed_files:
27+
description: 'List of renamed files matching the `files` filter'
28+
value: ${{ steps.get_changes.outputs.filtered_renamed_files }}
29+
30+
runs:
31+
using: 'composite'
32+
steps:
33+
- name: Gather changed files
34+
id: get_changes
35+
env:
36+
INPUT_HEAD: ${{ inputs.head || github.event.pull_request.head.ref || github.event.merge_group.head_ref || github.ref_name }}
37+
INPUT_OUTPUT_FILE: ${{ inputs.output_file }}
38+
shell: bash
39+
run: ${{ github.action_path }}/get-changed-files.sh
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
#!/bin/bash
2+
3+
# Required environment variables:
4+
# $INPUT_FILES: Pattern(s) to filter files by (e.g., "content/** data/**")
5+
# $INPUT_HEAD: Current branch or SHA for git diff
6+
# $INPUT_OUTPUT_FILE: Optional file to redirect output to.
7+
8+
# Default value for files parameter if not provided
9+
FILTER=${INPUT_FILES:-.}
10+
11+
# Print the filter
12+
echo "__ using filter: __"
13+
echo "$FILTER"
14+
15+
# Ensure we have the latest from the remote
16+
echo "__ fetching latest changes __"
17+
git fetch --depth=1 origin main
18+
git fetch --depth=1 origin ${INPUT_HEAD:-HEAD}
19+
20+
# Get diff with status information
21+
echo "__ running git diff with status __"
22+
DIFF_OUTPUT=$(git diff --name-status origin/main origin/${INPUT_HEAD:-HEAD})
23+
24+
# Function to extract files by pattern from diff output
25+
extract_files() {
26+
local pattern=$1
27+
local field=$2
28+
echo "$DIFF_OUTPUT" | grep -E "$pattern" | cut -f$field
29+
}
30+
31+
# Extract files by status
32+
echo "__ extracting files by status __"
33+
MODIFIED_FILES=$(extract_files "^[AM]" 2)
34+
DELETED_FILES=$(extract_files "^D" 2)
35+
RENAMED_OLD_FILES=$(extract_files "^R[0-9]+" 2)
36+
RENAMED_NEW_FILES=$(extract_files "^R[0-9]+" 3)
37+
38+
# Create paired renames in format "oldname=>newname"
39+
create_rename_pairs() {
40+
local old_files=$1
41+
local new_files=$2
42+
local pairs=()
43+
44+
IFS=$'\n'
45+
for i in $(seq 1 $(echo "$old_files" | wc -l)); do
46+
OLD=$(echo "$old_files" | sed -n "${i}p")
47+
NEW=$(echo "$new_files" | sed -n "${i}p")
48+
pairs+=("$OLD=>$NEW")
49+
done
50+
unset IFS
51+
52+
printf "%s\n" "${pairs[@]}"
53+
}
54+
55+
RENAMED_FILES_WITH_HISTORY=$(create_rename_pairs "$RENAMED_OLD_FILES" "$RENAMED_NEW_FILES")
56+
57+
# Combine files for different outputs
58+
DIFF=$(echo -e "$MODIFIED_FILES\n$RENAMED_NEW_FILES" | sort | uniq)
59+
ALL_DIFF=$(echo -e "$MODIFIED_FILES\n$DELETED_FILES\n$RENAMED_NEW_FILES" | sort | uniq)
60+
61+
# Debug output
62+
echo "__ MODIFIED files found __"
63+
echo "$MODIFIED_FILES"
64+
echo "__ DELETED files found __"
65+
echo "$DELETED_FILES"
66+
echo "__ RENAMED files found (with history) __"
67+
echo "$RENAMED_FILES_WITH_HISTORY"
68+
echo "__ ALL changed files __"
69+
echo "$ALL_DIFF"
70+
71+
# Function to filter files by pattern
72+
filter_files() {
73+
local files=$1
74+
local result=""
75+
76+
IFS=$'\n'
77+
for file in $files; do
78+
while IFS= read -r pattern || [ -n "$pattern" ]; do
79+
clean_pattern=${pattern%/}
80+
if [[ $file == $clean_pattern || $file == $clean_pattern/* ]]; then
81+
result="$result $file"
82+
break
83+
fi
84+
done <<< "$FILTER"
85+
done
86+
unset IFS
87+
88+
echo "$result"
89+
}
90+
91+
# Function to filter rename pairs
92+
filter_renames() {
93+
local new_files=$1
94+
local old_files=$2
95+
local result=""
96+
97+
IFS=$'\n'
98+
for i in $(seq 1 $(echo "$new_files" | wc -l)); do
99+
NEW=$(echo "$new_files" | sed -n "${i}p")
100+
OLD=$(echo "$old_files" | sed -n "${i}p")
101+
102+
while IFS= read -r pattern || [ -n "$pattern" ]; do
103+
clean_pattern=${pattern%/}
104+
if [[ $NEW == $clean_pattern || $NEW == $clean_pattern/* ]]; then
105+
result="$result $OLD=>$NEW"
106+
break
107+
fi
108+
done <<< "$FILTER"
109+
done
110+
unset IFS
111+
112+
echo "$result"
113+
}
114+
115+
# Filter the files to just the directories specified in the input files
116+
if [ "$FILTER" != "." ]; then
117+
echo "__ filtering files to only include $FILTER __"
118+
119+
FILTERED_MODIFIED=$(filter_files "$MODIFIED_FILES")
120+
FILTERED_DELETED=$(filter_files "$DELETED_FILES")
121+
FILTERED_RENAMED=$(filter_renames "$RENAMED_NEW_FILES" "$RENAMED_OLD_FILES")
122+
123+
# For filtered_changed_files (non-deleted files)
124+
FILTERED_DIFF="$FILTERED_MODIFIED"
125+
for new_file in $(echo "$FILTERED_RENAMED" | grep -o "=>[^[:space:]]*" | sed 's/=>//g'); do
126+
FILTERED_DIFF="$FILTERED_DIFF $new_file"
127+
done
128+
129+
MODIFIED_FILES=$FILTERED_MODIFIED
130+
DELETED_FILES=$FILTERED_DELETED
131+
RENAMED_FILES_WITH_HISTORY=$FILTERED_RENAMED
132+
DIFF=$FILTERED_DIFF
133+
134+
echo "__ filtered MODIFIED files __"
135+
echo "$MODIFIED_FILES"
136+
echo "__ filtered DELETED files __"
137+
echo "$DELETED_FILES"
138+
echo "__ filtered RENAMED files (with history) __"
139+
echo "$RENAMED_FILES_WITH_HISTORY"
140+
echo "__ filtered changed files (non-deleted) __"
141+
echo "$FILTERED_DIFF"
142+
fi
143+
144+
# Function to format output (standardize whitespace)
145+
format_output() {
146+
local input=$1
147+
echo "$input" | tr '\n' ' ' | tr -s ' ' | sed 's/^ *//' | sed 's/ *$//'
148+
}
149+
150+
echo "__ formatting output __"
151+
FORMATTED_MODIFIED=$(format_output "$MODIFIED_FILES")
152+
FORMATTED_DELETED=$(format_output "$DELETED_FILES")
153+
FORMATTED_DIFF=$(format_output "$DIFF")
154+
FORMATTED_RENAMED=$(format_output "$RENAMED_FILES_WITH_HISTORY")
155+
ALL_FORMATTED=$(format_output "$ALL_DIFF")
156+
157+
echo "Formatted modified: '$FORMATTED_MODIFIED'"
158+
echo "Formatted deleted: '$FORMATTED_DELETED'"
159+
echo "Formatted renamed: '$FORMATTED_RENAMED'"
160+
echo "Formatted non-deleted changes: '$FORMATTED_DIFF'"
161+
162+
# Set the output for GitHub Actions
163+
HAS_CHANGES=true
164+
if [[ -z "$FORMATTED_DIFF" && -z "$FORMATTED_DELETED" ]]; then
165+
echo "No changed files detected"
166+
HAS_CHANGES=false
167+
fi
168+
169+
# Function to set outputs either to a file or GITHUB_OUTPUT
170+
set_outputs() {
171+
local target=$1
172+
173+
if [[ "$HAS_CHANGES" == "false" ]]; then
174+
echo "Setting empty outputs to $target"
175+
echo "all_changed_files=" >> "$target"
176+
echo "filtered_changed_files=" >> "$target"
177+
echo "filtered_deleted_files=" >> "$target"
178+
echo "filtered_renamed_files=" >> "$target"
179+
else
180+
echo "Setting non-empty outputs to $target"
181+
echo "all_changed_files<<EOF" >> "$target"
182+
echo "$ALL_FORMATTED" >> "$target"
183+
echo "EOF" >> "$target"
184+
185+
echo "filtered_changed_files<<EOF" >> "$target"
186+
echo "$FORMATTED_DIFF" >> "$target"
187+
echo "EOF" >> "$target"
188+
189+
echo "filtered_deleted_files<<EOF" >> "$target"
190+
echo "$FORMATTED_DELETED" >> "$target"
191+
echo "EOF" >> "$target"
192+
193+
echo "filtered_renamed_files<<EOF" >> "$target"
194+
echo "$FORMATTED_RENAMED" >> "$target"
195+
echo "EOF" >> "$target"
196+
fi
197+
}
198+
199+
# Set outputs to the appropriate target
200+
if [[ -n "$INPUT_OUTPUT_FILE" ]]; then
201+
set_outputs "$INPUT_OUTPUT_FILE"
202+
else
203+
set_outputs "$GITHUB_OUTPUT"
204+
fi

.github/actions/install-cocofix/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ runs:
1818
npm install --no-save \
1919
'--@github:registry=https://npm.pkg.github.com' \
2020
'--//npm.pkg.github.com/:_authToken=${TOKEN}' \
21-
@github/cocofix
21+
@github/cocofix codeql-ts

.github/actions/labeler/labeler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import coreLib from '@actions/core'
44
import { type Octokit } from '@octokit/rest'
55
import { CoreInject } from '@/links/scripts/action-injections'
66

7-
import github from '#src/workflows/github.ts'
8-
import { getActionContext } from '#src/workflows/action-context.ts'
9-
import { boolEnvVar } from '#src/workflows/get-env-inputs.ts'
7+
import github from '@/workflows/github'
8+
import { getActionContext } from '@/workflows/action-context'
9+
import { boolEnvVar } from '@/workflows/get-env-inputs'
1010

1111
type Options = {
1212
addLabels?: string[]

.github/branch_protection_settings/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)