Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/actions/get-changed-files/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@ name: Get changed files
description: Get a list of changed files

inputs:
files:
description: 'Files or directories to check for changes'
file_filter:
description: 'Files or directories to check for changes, supports names, directories, trailing slashes, and single trailing wildcard'
required: false
default: '.'
head:
description: 'Head ref to check for changes against'
required: false
pr:
description: 'The PR to check for changes against'
required: false
token:
description: 'The token'
required: true
output_file:
description: 'Optional file path to write the changes to'
required: false

outputs:
all_changed_files:
description: 'List of all changed files (unfiltered)'
value: ${{ steps.get_changes.outputs.all_changed_files }}
filtered_changed_files:
description: 'List of changed files matching the filter'
description: 'List of changed files matching the `files` filter'
value: ${{ steps.get_changes.outputs.filtered_changed_files }}

runs:
Expand All @@ -25,7 +34,9 @@ runs:
id: get_changes
env:
INPUT_FILES: ${{ inputs.files }}
PR: ${{ github.event.pull_request.number }}
HEAD: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref || inputs.head || github.ref_name }}
INPUT_PR: ${{ inputs.pr || github.event.pull_request.number }}
INPUT_HEAD: ${{ inputs.head || github.event.pull_request.head.ref || github.event.merge_group.head_ref || github.ref_name }}
INPUT_OUTPUT_FILE: ${{ inputs.output_file }}
GH_TOKEN: ${{ inputs.token }}
shell: bash
run: ${{ github.action_path }}/get-changed-files.sh
26 changes: 17 additions & 9 deletions .github/actions/get-changed-files/get-changed-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

# Required environment variables:
# $INPUT_FILES: Pattern(s) to filter files by (e.g., "content/** data/**")
# $FILTER: Derived from INPUT_FILES, defaults to "." if not provided
# $PR: Pull request number (if running in PR context)
# $HEAD: Current branch or SHA for git diff
# $INPUT_PR: Pull request number (if running in PR context)
# $INPUT_HEAD: Current branch or SHA for git diff
# $INPUT_OUTPUT_FILE: Optional file to redirect output to.
# $GH_TOKEN: the access token

# Default value for files parameter if not provided
FILTER=${INPUT_FILES:-.}
Expand All @@ -16,21 +17,21 @@ echo "$FILTER"
# Find the file diff in the pull request or merge group
# If its a pull request, use the faster call to the GitHub API
# For push, workflow_dispatch, and merge_group, use git diff
if [ -n "$PR" ]
if [ -n "$INPUT_PR" ]
then
echo "__ running gh pr diff __"
DIFF=`gh pr diff $PR --name-only`
DIFF=$(gh pr diff $INPUT_PR --name-only)
if [ -z "$DIFF" ]; then
echo "__ gh pr diff failed, falling back to git diff __"
HEAD=$(gh pr view $PR --json headRefName --jq .headRefName)
HEAD=$(gh pr view $INPUT_PR --json headRefName --jq .headRefName)
fi
fi

if [ -z "$DIFF" ]; then
echo "__ using branch name $HEAD __"
echo "__ using branch name $INPUT_HEAD __"
git fetch origin main --depth 1
echo "__ running git diff __"
DIFF=`git diff --name-only origin/main $HEAD`
DIFF=$(git diff --name-only origin/main $INPUT_HEAD)
fi

# So we can inspect the output
Expand Down Expand Up @@ -64,9 +65,16 @@ echo "$FORMATTED_DIFF"

# Set the output for GitHub Actions
if [[ -n "$GITHUB_OUTPUT" ]]; then
echo "all_changed_files=$DIFF" >> "$GITHUB_OUTPUT"
ALL_FORMATTED=$(echo "$DIFF" | tr '\n' ' ' | tr -s ' ')
echo "all_changed_files=$ALL_FORMATTED" >> "$GITHUB_OUTPUT"
echo "filtered_changed_files=$FORMATTED_DIFF" >> "$GITHUB_OUTPUT"
else
echo "all_changed_files=$DIFF"
echo "filtered_changed_files=$FORMATTED_DIFF"
fi

# If output file is specified, write the filtered changes to it
if [[ -n "$INPUT_OUTPUT_FILE" ]]; then
echo "$FORMATTED_DIFF" > "$INPUT_OUTPUT_FILE"
echo "__ wrote changes to $INPUT_OUTPUT_FILE __"
fi
15 changes: 6 additions & 9 deletions .github/workflows/content-lint-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,37 @@ jobs:
- name: Check out repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Picking this number is a "best guess". If we make it too large,
# the checkout will take potentially unnecessariily long.
# This reduces the chance that tj-actions/changed-files has to
# fetch deeper history. But if it needs to, it will.
fetch-depth: 10

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

- name: Get changed content/data files
id: changed-files
id: changed_files
uses: ./.github/actions/get-changed-files
with:
files: |
content/**
data/**
token: ${{ secrets.GITHUB_TOKEN }}

- name: Print content linter annotations if changed content/data files
if: steps.changed-files.outputs.filtered_changed_files
if: steps.changed_files.outputs.filtered_changed_files
env:
# Make it an environment variable so that its value doesn't need to be escaped.
# See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
CHANGED_FILES: |-
${{ steps.changed-files.outputs.filtered_changed_files }}
${{ steps.changed_files.outputs.filtered_changed_files }}
# If there are errors, using `--print-annotations` will make it
# so it does *not* exit non-zero.
# This is so that all warnings and errors are printed.
run: npm run lint-content -- --print-annotations --paths $CHANGED_FILES

- name: Run content linter if changed content/data files
if: steps.changed-files.outputs.any_changed == 'true'
if: steps.changed_files.outputs.any_changed == 'true'
env:
# Make it an environment variable so that its value doesn't need to be escaped.
# See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
CHANGED_FILES: |-
${{ steps.changed-files.outputs.filtered_changed_files }}
${{ steps.changed_files.outputs.filtered_changed_files }}
run: npm run lint-content -- --errors-only --paths $CHANGED_FILES
37 changes: 6 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,37 +131,12 @@ jobs:

- name: Gather files changed
if: ${{ matrix.name == 'content-linter' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
HEAD: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
run: |
# Find the file diff in the pull request or merge group
# If its a pull request, use the faster call to the GitHub API
# For push, workflow_dispatch, and merge_group, use git diff
if [ -n "$PR" ]
then
echo __ running gh pr diff __
DIFF=`gh pr diff $PR --name-only`
elif [ -n "$HEAD" ]
then
echo __ running git fetch main __
git fetch origin main --depth 1
echo __ running git diff __
DIFF=`git diff --name-only origin/main`
else
echo __ no head, empty diff __
DIFF=''
fi
# So we can inspect the output
echo __ DIFF found __
echo $DIFF

# So that becomes a string like `foo.js path/bar.md`
# Must do this because the list of files can be HUGE. Especially
# in a repo-sync when there are lots of translation files involved.
echo __ format, write to get_diff_files.txt __
echo $DIFF | tr '\n' ' ' > get_diff_files.txt
uses: ./.github/actions/get-changed-files
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr: ${{ github.event.pull_request.number }}
head: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
output_file: get_diff_files.txt

- uses: ./.github/actions/cache-nextjs

Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions data/features/allow-actions-to-approve-pr-with-ent-repo.yml

This file was deleted.

6 changes: 0 additions & 6 deletions data/features/answered-fields-for-discussions.yml

This file was deleted.

6 changes: 0 additions & 6 deletions data/features/archive-organizations.yml

This file was deleted.

6 changes: 0 additions & 6 deletions data/features/classic-project-visibility-permissions.yml

This file was deleted.

1 change: 0 additions & 1 deletion data/reusables/apps/enterprise-apps-beta.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/ghes-releases/lib/enterprise-dates.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"deprecationDate": "2026-03-11"
},
"3.17": {
"releaseDate": "2025-05-13",
"releaseDate": "2025-05-20",
"deprecationDate": "2026-06-03"
},
"3.18": {
Expand Down