diff --git a/.github/actions/get-changed-files/action.yml b/.github/actions/get-changed-files/action.yml index ac1beb3a41d5..6d6d7c572b0d 100644 --- a/.github/actions/get-changed-files/action.yml +++ b/.github/actions/get-changed-files/action.yml @@ -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: @@ -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 diff --git a/.github/actions/get-changed-files/get-changed-files.sh b/.github/actions/get-changed-files/get-changed-files.sh index f939de58fff9..e7a13a7ecb19 100755 --- a/.github/actions/get-changed-files/get-changed-files.sh +++ b/.github/actions/get-changed-files/get-changed-files.sh @@ -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:-.} @@ -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 @@ -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 diff --git a/.github/workflows/content-lint-markdown.yml b/.github/workflows/content-lint-markdown.yml index 596738836233..c5a8bee40914 100644 --- a/.github/workflows/content-lint-markdown.yml +++ b/.github/workflows/content-lint-markdown.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2375e95c67d..30b4ff812fe5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/data/features/actions-default-workflow-permissions-restrictive.yml b/data/features/actions-default-workflow-permissions-restrictive.yml deleted file mode 100644 index 5c0d7790a554..000000000000 --- a/data/features/actions-default-workflow-permissions-restrictive.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Reference: #9014. -# Versioning for enterprise/organization/repository policy settings for workflow permissions granted to GITHUB_TOKEN to be readonly by default and not allow GitHub Actions to create or approve pull requests. -versions: - fpt: '*' - ghec: '*' - ghes: '>=3.9' diff --git a/data/features/allow-actions-to-approve-pr-with-ent-repo.yml b/data/features/allow-actions-to-approve-pr-with-ent-repo.yml deleted file mode 100644 index 85f360ca9690..000000000000 --- a/data/features/allow-actions-to-approve-pr-with-ent-repo.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Reference: #6926. -# Versioning for enterprise/repository policy settings for workflow PR creation or approval permission. This is only the enterprise and repo settings! For the previous separate ship for the org setting (that only overed approvals), see the allow-actions-to-approve-pr flag. -versions: - fpt: '*' - ghec: '*' - ghes: '>=3.6' diff --git a/data/features/answered-fields-for-discussions.yml b/data/features/answered-fields-for-discussions.yml deleted file mode 100644 index d1e7ac5707bf..000000000000 --- a/data/features/answered-fields-for-discussions.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Reference: #12006 - -versions: - fpt: '*' - ghec: '*' - ghes: '>=3.12' diff --git a/data/features/archive-organizations.yml b/data/features/archive-organizations.yml deleted file mode 100644 index cefc247007ff..000000000000 --- a/data/features/archive-organizations.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Issue 10218 -# Archive entire Organization -versions: - fpt: '*' - ghec: '*' - ghes: '>=3.11' diff --git a/data/features/classic-project-visibility-permissions.yml b/data/features/classic-project-visibility-permissions.yml deleted file mode 100644 index 4378df58b176..000000000000 --- a/data/features/classic-project-visibility-permissions.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Issue 7720 -# Organization owners can restrict public projects (classic) -versions: - fpt: '*' - ghec: '*' - ghes: '>3.6' diff --git a/data/reusables/apps/enterprise-apps-beta.md b/data/reusables/apps/enterprise-apps-beta.md deleted file mode 100644 index 62f4c58856d4..000000000000 --- a/data/reusables/apps/enterprise-apps-beta.md +++ /dev/null @@ -1 +0,0 @@ ->[!NOTE] Enterprise-owned {% data variables.product.prodname_github_apps %} are currently in {% data variables.release-phases.public_preview %} and subject to change. diff --git a/src/ghes-releases/lib/enterprise-dates.json b/src/ghes-releases/lib/enterprise-dates.json index f9a2afad3dfa..fbf03ee20516 100644 --- a/src/ghes-releases/lib/enterprise-dates.json +++ b/src/ghes-releases/lib/enterprise-dates.json @@ -164,7 +164,7 @@ "deprecationDate": "2026-03-11" }, "3.17": { - "releaseDate": "2025-05-13", + "releaseDate": "2025-05-20", "deprecationDate": "2026-06-03" }, "3.18": {