From 0d481fb38d2c015a1328fefdb76ec8e0c708f57e Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Thu, 27 Nov 2025 18:24:34 +0100 Subject: [PATCH 01/10] chore: add check changelogs bash script --- .github/actions/check-changelog/action.yml | 19 --- .github/actions/check-changelog/entrypoint.sh | 37 ------ .../actions/detect-package-changes/action.yml | 13 -- .../detect-package-changes/entrypoint.sh | 26 ---- .github/workflows/changelog.yml | 44 ++----- scripts/check_changelogs.sh | 119 ++++++++++++++++++ 6 files changed, 128 insertions(+), 130 deletions(-) delete mode 100644 .github/actions/check-changelog/action.yml delete mode 100755 .github/actions/check-changelog/entrypoint.sh delete mode 100644 .github/actions/detect-package-changes/action.yml delete mode 100755 .github/actions/detect-package-changes/entrypoint.sh create mode 100755 scripts/check_changelogs.sh diff --git a/.github/actions/check-changelog/action.yml b/.github/actions/check-changelog/action.yml deleted file mode 100644 index 732cf2804bf..00000000000 --- a/.github/actions/check-changelog/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Check changelog -description: Ensures each modified package has a changelog entry in changelogs/upcoming -inputs: - pr-number: - required: true - description: PR number used as the changelog filename - package-path: - required: false - description: The base path of the package to check for a changelog. If not provided, it will check all packages. -runs: - using: 'composite' - steps: - - name: Check for changelog entry - shell: bash - run: .github/actions/check-changelog/entrypoint.sh - env: - PR_NUMBER: ${{ inputs.pr-number }} - PACKAGE_PATH: ${{ inputs.package-path }} - diff --git a/.github/actions/check-changelog/entrypoint.sh b/.github/actions/check-changelog/entrypoint.sh deleted file mode 100755 index 9ca9546ec9c..00000000000 --- a/.github/actions/check-changelog/entrypoint.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# Exit on error -set -e - -# The PR number and package path provided as input -PR_NUMBER="${PR_NUMBER}" -PACKAGE_PATH="${PACKAGE_PATH}" - -# Search for the changelog file -if [ -n "$PACKAGE_PATH" ]; then - # Check specific package - echo "Checking package: $PACKAGE_PATH" - changelog_files=$(find "${PACKAGE_PATH}/changelogs/upcoming/" -type f -name "${PR_NUMBER}.md" 2>/dev/null || true) - package_name=$(basename "$PACKAGE_PATH") - - if [ -z "$changelog_files" ]; then - echo "❌ Changelog file for PR #${PR_NUMBER} is missing in package '${package_name}'." - echo "You need to add a changelog to this PR before it can be merged. See https://github.com/elastic/eui/blob/main/wiki/contributing-to-eui/documenting/changelogs.md" - exit 1 - else - echo "✅ Changelog file for PR #${PR_NUMBER} found in package '${package_name}': $changelog_files" - exit 0 - fi -else - # Search for the changelog file across all packages - changelog_files=$(find packages/*/changelogs/upcoming/ -type f -name "${PR_NUMBER}.md") - - if [ -z "$changelog_files" ]; then - echo "❌ Changelog file for PR #${PR_NUMBER} is missing." - echo "You need to add a changelog to this PR before it can be merged. See https://github.com/elastic/eui/blob/main/wiki/contributing-to-eui/documenting/changelogs.md" - exit 1 - else - echo "✅ Changelog file for PR #${PR_NUMBER} found: $changelog_files" - exit 0 - fi -fi \ No newline at end of file diff --git a/.github/actions/detect-package-changes/action.yml b/.github/actions/detect-package-changes/action.yml deleted file mode 100644 index d2932ccd60a..00000000000 --- a/.github/actions/detect-package-changes/action.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Detect package changes -description: 'Detects which public packages have changed based on git diff' -outputs: - changed-packages: - description: 'A JSON array of changed public package names' - value: ${{ steps.changes.outputs.changed-packages }} -runs: - using: 'composite' - steps: - - name: Detect package changes - id: changes - shell: bash - run: ${{ github.action_path }}/entrypoint.sh diff --git a/.github/actions/detect-package-changes/entrypoint.sh b/.github/actions/detect-package-changes/entrypoint.sh deleted file mode 100755 index 93a1597bfc8..00000000000 --- a/.github/actions/detect-package-changes/entrypoint.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Exit on error -set -e - -# Get the list of changed files -changed_files=$(git diff --name-only origin/main...HEAD) - -# Find all public packages and check for changes -public_packages=() -for dir in packages/*/; do - if [ -f "${dir}package.json" ] && ! grep -q '"private": true' "${dir}package.json"; then - package_name=$(basename "$dir") - if echo "$changed_files" | grep -q "^packages/$package_name/"; then - public_packages+=("\"$package_name\"") - fi - fi -done - -# Output a JSON array of changed package names -if [ ${#public_packages[@]} -gt 0 ]; then - changed_list=$(IFS=,; echo "[${public_packages[*]}]") - echo "changed-packages=$changed_list" >> $GITHUB_OUTPUT -else - echo "changed-packages=[]" >> $GITHUB_OUTPUT -fi diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index bc69faae73d..9c762a65a0a 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,46 +1,20 @@ -name: "Changelog required" +name: 'Changelog required' on: pull_request: types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] branches: [main] jobs: - # Check for changes in all public packages, needed in the `changelog` job - detect-changes: + changelog: runs-on: ubuntu-latest - outputs: - changed-packages: ${{ steps.changes.outputs.changed-packages }} steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Detect package changes - id: changes - uses: ./.github/actions/detect-package-changes - - # Enforces the update of a changelog file on every pull request for all public packages - # unless the PR contains the `skip-changelog` label - changelog-checks: - needs: detect-changes - runs-on: ubuntu-latest - strategy: - matrix: - package: ${{ fromJson(needs.detect-changes.outputs.changed-packages) }} - steps: - - uses: actions/checkout@v2 - - name: Check changelog for ${{ matrix.package }} - # TODO specific "package" labels could be checked here? - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changelog') }} - uses: ./.github/actions/check-changelog - with: - pr-number: ${{ github.event.pull_request.number }} - package-path: packages/${{ matrix.package }} - - # This job will always run and succeed, ensuring the overall check completes. - changelog: - needs: changelog-checks - runs-on: ubuntu-latest - if: always() - steps: - - name: Finish changelog checks - run: echo "Changelog checks finished." \ No newline at end of file + - name: Check changelogs + run: | + ./scripts/check_changelogs.sh \ + "${{ github.event.pull_request.number }}" \ + "${{ join(github.event.pull_request.labels.*.name, '|') }}" + env: + GITHUB_BASE_REF: ${{ github.base_ref }} diff --git a/scripts/check_changelogs.sh b/scripts/check_changelogs.sh new file mode 100755 index 00000000000..c3d806d08de --- /dev/null +++ b/scripts/check_changelogs.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +# This script checks that a changelog entry exists for every changed public package in a PR. +# +# Skip logic: +# +# - if a package is private, changelog check for that specific package is skipped, +# - if "skip-changelog" label is present, all changelog checks are skipped, +# - if "skip-changelog-" is present, changelog check for that specific package is skipped. + +set -e + +# The Pull Request ID +PR_NUMBER="$1" +# Pipe-separated list of labels applied to the PR +LABELS="$2" +# Base ref to compare against (defaults to `origin/main`) +BASE_REF="origin/${GITHUB_BASE_REF:-main}" + +if [ -z "$PR_NUMBER" ]; then + echo "Error: PR_NUMBER argument is missing." + echo "Usage: $0 [labels]" + exit 1 +fi + +# Check if a label exists in the list +has_label() { + local label="$1" + local labels_piped="|$LABELS|" + [[ "$labels_piped" == *"|$label|"* ]] +} + +# Check for global skip +if has_label "skip-changelog"; then + echo "⏩ \`skip-changelog\` label detected. Skipping all changelog checks." + exit 0 +fi + +# Ensure we have `origin/main` for diffing +# This check prevents "ambiguous argument 'origin/main...HEAD'" errors +# if shallow clone missed the ref +if ! git rev-parse --verify "$BASE_REF" >/dev/null 2>&1; then + echo "⚠️ \`$BASE_REF\` reference not found. Attempting to fetch..." + git fetch origin "${GITHUB_BASE_REF:-main}:$BASE_REF" --depth=1 || echo "Warning: Fetch failed, git diff might fail." +fi + +echo "🔍 Detecting changed public packages..." + +# Get list of changed files +CHANGED_FILES=$(git diff --name-only "$BASE_REF...HEAD") + +CHANGED_PACKAGES=() +MISSING_CHANGELOGS=() + +# Iterate over all directories in `packages/` +# Assumption: `packages//` +for pkg_dir in packages/*/; do + [ -d "$pkg_dir" ] || continue + + # Remove trailing slash + pkg_path="${pkg_dir%/}" + pkg_name=$(basename "$pkg_path") + package_json="$pkg_path/package.json" + + # Check if `package.json` exists + if [ ! -f "$package_json" ]; then + continue + fi + + # Skip private packages + is_private=$(node -p "try { require('./$package_json').private } catch(e) { false }" 2>/dev/null) + if [ "$is_private" == "true" ]; then + continue + fi + + # We look for "packages//" prefix in the changed files list + if echo "$CHANGED_FILES" | grep -Fq "packages/$pkg_name/"; then + CHANGED_PACKAGES+=("$pkg_name") + fi +done + +if [ ${#CHANGED_PACKAGES[@]} -eq 0 ]; then + echo "✅ No public package changes detected." + exit 0 +fi + +echo "Impacted packages: ${CHANGED_PACKAGES[*]}" + +for pkg_name in "${CHANGED_PACKAGES[@]}"; do + # Check for package-specific skip label + if has_label "skip-changelog-$pkg_name"; then + echo "⏩ Skipping changelog check for \`$pkg_name\` (label \`skip-changelog-$pkg_name\` present)." + continue + fi + + CHANGELOG_FILE="packages/$pkg_name/changelogs/upcoming/$PR_NUMBER.md" + + if [ -f "$CHANGELOG_FILE" ]; then + echo "✅ \`$pkg_name\`: Changelog entry found ($CHANGELOG_FILE)." + else + echo "🚫 \`$pkg_name\`: Changelog entry missing." + MISSING_CHANGELOGS+=("$pkg_name") + fi +done + +# Report failures +if [ ${#MISSING_CHANGELOGS[@]} -gt 0 ]; then + echo "🚫 The following packages are modified but miss a changelog entry:" + for pkg in "${MISSING_CHANGELOGS[@]}"; do + echo " - $pkg" + done + echo "Please add an \`.md\` file named \`${PR_NUMBER}.md\` to the \`changelogs/upcoming/\` directory of the respective packages." + echo "Example: \`packages/${MISSING_CHANGELOGS[0]}/changelogs/upcoming/${PR_NUMBER}.md\`" + echo "You can read more about changelogs here: https://github.com/elastic/eui/blob/main/wiki/contributing-to-eui/documenting/changelogs.md" + exit 1 +else + echo "🎉 All changelog requirements satisfied." + exit 0 +fi From 7cb87f9e5fc23d0ea51c2557e6e17b6768b5b67d Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Fri, 28 Nov 2025 12:09:02 +0100 Subject: [PATCH 02/10] chore: remove summary, too verbose --- scripts/check_changelogs.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/check_changelogs.sh b/scripts/check_changelogs.sh index c3d806d08de..0f7f280ea96 100755 --- a/scripts/check_changelogs.sh +++ b/scripts/check_changelogs.sh @@ -105,10 +105,6 @@ done # Report failures if [ ${#MISSING_CHANGELOGS[@]} -gt 0 ]; then - echo "🚫 The following packages are modified but miss a changelog entry:" - for pkg in "${MISSING_CHANGELOGS[@]}"; do - echo " - $pkg" - done echo "Please add an \`.md\` file named \`${PR_NUMBER}.md\` to the \`changelogs/upcoming/\` directory of the respective packages." echo "Example: \`packages/${MISSING_CHANGELOGS[0]}/changelogs/upcoming/${PR_NUMBER}.md\`" echo "You can read more about changelogs here: https://github.com/elastic/eui/blob/main/wiki/contributing-to-eui/documenting/changelogs.md" From d6c1d0f8d024997e59f5d3e80f1f5e5a6313f6b2 Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Fri, 28 Nov 2025 12:22:31 +0100 Subject: [PATCH 03/10] chore: add comma to impacted packages for clarity --- scripts/check_changelogs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/check_changelogs.sh b/scripts/check_changelogs.sh index 0f7f280ea96..67df2ac4734 100755 --- a/scripts/check_changelogs.sh +++ b/scripts/check_changelogs.sh @@ -84,7 +84,8 @@ if [ ${#CHANGED_PACKAGES[@]} -eq 0 ]; then exit 0 fi -echo "Impacted packages: ${CHANGED_PACKAGES[*]}" +# Comma-delimited list of impacted packages +echo "📦 Impacted packages: $(echo "${CHANGED_PACKAGES[*]}" | sed 's/ /, /g')" for pkg_name in "${CHANGED_PACKAGES[@]}"; do # Check for package-specific skip label From e558aedcdcd9748a56c43208dbf2679532535cee Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Fri, 28 Nov 2025 12:31:48 +0100 Subject: [PATCH 04/10] chore: add a list of changed files --- scripts/check_changelogs.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/check_changelogs.sh b/scripts/check_changelogs.sh index 67df2ac4734..cbd8b97375e 100755 --- a/scripts/check_changelogs.sh +++ b/scripts/check_changelogs.sh @@ -14,8 +14,12 @@ set -e PR_NUMBER="$1" # Pipe-separated list of labels applied to the PR LABELS="$2" +# Remote name (defaults to `origin`) +REMOTE_NAME="origin" +# Target branch (defaults to `main`) +TARGET_BRANCH="${GITHUB_BASE_REF:-main}" # Base ref to compare against (defaults to `origin/main`) -BASE_REF="origin/${GITHUB_BASE_REF:-main}" +BASE_REF="$REMOTE_NAME/$TARGET_BRANCH" if [ -z "$PR_NUMBER" ]; then echo "Error: PR_NUMBER argument is missing." @@ -41,14 +45,18 @@ fi # if shallow clone missed the ref if ! git rev-parse --verify "$BASE_REF" >/dev/null 2>&1; then echo "⚠️ \`$BASE_REF\` reference not found. Attempting to fetch..." - git fetch origin "${GITHUB_BASE_REF:-main}:$BASE_REF" --depth=1 || echo "Warning: Fetch failed, git diff might fail." + git fetch "$REMOTE_NAME" "$TARGET_BRANCH:$BASE_REF" --depth=1 || echo "Warning: Fetch failed, git diff might fail." fi echo "🔍 Detecting changed public packages..." -# Get list of changed files CHANGED_FILES=$(git diff --name-only "$BASE_REF...HEAD") +if [ -n "$CHANGED_FILES" ]; then + echo "Changed files:" + echo "$CHANGED_FILES" | sed 's/^/- /' +fi + CHANGED_PACKAGES=() MISSING_CHANGELOGS=() @@ -73,7 +81,7 @@ for pkg_dir in packages/*/; do continue fi - # We look for "packages//" prefix in the changed files list + # We look for `packages//` prefix in the changed files list if echo "$CHANGED_FILES" | grep -Fq "packages/$pkg_name/"; then CHANGED_PACKAGES+=("$pkg_name") fi @@ -104,7 +112,6 @@ for pkg_name in "${CHANGED_PACKAGES[@]}"; do fi done -# Report failures if [ ${#MISSING_CHANGELOGS[@]} -gt 0 ]; then echo "Please add an \`.md\` file named \`${PR_NUMBER}.md\` to the \`changelogs/upcoming/\` directory of the respective packages." echo "Example: \`packages/${MISSING_CHANGELOGS[0]}/changelogs/upcoming/${PR_NUMBER}.md\`" From 99df676ca9f10808dd12f58a879d39c6f7ef042a Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com> Date: Fri, 28 Nov 2025 14:31:59 +0100 Subject: [PATCH 05/10] Update scripts/check_changelogs.sh Co-authored-by: Arturo Castillo Delgado --- scripts/check_changelogs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_changelogs.sh b/scripts/check_changelogs.sh index cbd8b97375e..7185dd9fe87 100755 --- a/scripts/check_changelogs.sh +++ b/scripts/check_changelogs.sh @@ -92,8 +92,8 @@ if [ ${#CHANGED_PACKAGES[@]} -eq 0 ]; then exit 0 fi -# Comma-delimited list of impacted packages -echo "📦 Impacted packages: $(echo "${CHANGED_PACKAGES[*]}" | sed 's/ /, /g')" +# Comma-delimited list of packages detected +echo "📦 Changed packages: $(echo "${CHANGED_PACKAGES[*]}" | sed 's/ /, /g')" for pkg_name in "${CHANGED_PACKAGES[@]}"; do # Check for package-specific skip label From 14e9bb849f28cc5c50d72d2663ddeb6508656605 Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Tue, 2 Dec 2025 17:20:15 +0100 Subject: [PATCH 06/10] chore: bump to actions/checkout@v5 --- .github/workflows/changelog.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 9c762a65a0a..8343314f5d7 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -8,9 +8,7 @@ jobs: changelog: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - uses: actions/checkout@v5 - name: Check changelogs run: | ./scripts/check_changelogs.sh \ From 7153598996b66418653171658211b95e68482955 Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Tue, 2 Dec 2025 17:21:14 +0100 Subject: [PATCH 07/10] chore: use ubuntu-slim --- .github/workflows/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 8343314f5d7..13d255f1ae3 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -6,7 +6,7 @@ on: jobs: changelog: - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v5 - name: Check changelogs From a4664ff8736396ec5ed167c18dda0423cf26ccb5 Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Tue, 2 Dec 2025 18:17:51 +0100 Subject: [PATCH 08/10] chore: use yarn workspaces to simplify the script --- scripts/check_changelogs.sh | 39 ++++++++----------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/scripts/check_changelogs.sh b/scripts/check_changelogs.sh index 7185dd9fe87..b4d06df8725 100755 --- a/scripts/check_changelogs.sh +++ b/scripts/check_changelogs.sh @@ -40,14 +40,6 @@ if has_label "skip-changelog"; then exit 0 fi -# Ensure we have `origin/main` for diffing -# This check prevents "ambiguous argument 'origin/main...HEAD'" errors -# if shallow clone missed the ref -if ! git rev-parse --verify "$BASE_REF" >/dev/null 2>&1; then - echo "⚠️ \`$BASE_REF\` reference not found. Attempting to fetch..." - git fetch "$REMOTE_NAME" "$TARGET_BRANCH:$BASE_REF" --depth=1 || echo "Warning: Fetch failed, git diff might fail." -fi - echo "🔍 Detecting changed public packages..." CHANGED_FILES=$(git diff --name-only "$BASE_REF...HEAD") @@ -60,29 +52,12 @@ fi CHANGED_PACKAGES=() MISSING_CHANGELOGS=() -# Iterate over all directories in `packages/` -# Assumption: `packages//` -for pkg_dir in packages/*/; do - [ -d "$pkg_dir" ] || continue - - # Remove trailing slash - pkg_path="${pkg_dir%/}" +# For all public workspaces +for pkg_path in $(yarn workspaces list --json --no-private | jq -r '.location'); do pkg_name=$(basename "$pkg_path") - package_json="$pkg_path/package.json" - - # Check if `package.json` exists - if [ ! -f "$package_json" ]; then - continue - fi - - # Skip private packages - is_private=$(node -p "try { require('./$package_json').private } catch(e) { false }" 2>/dev/null) - if [ "$is_private" == "true" ]; then - continue - fi - # We look for `packages//` prefix in the changed files list - if echo "$CHANGED_FILES" | grep -Fq "packages/$pkg_name/"; then + # we look for the package path in the changed files list + if echo "$CHANGED_FILES" | grep -Fq "$pkg_path/"; then CHANGED_PACKAGES+=("$pkg_name") fi done @@ -92,16 +67,18 @@ if [ ${#CHANGED_PACKAGES[@]} -eq 0 ]; then exit 0 fi -# Comma-delimited list of packages detected +# Comma-delimited list of changed packages echo "📦 Changed packages: $(echo "${CHANGED_PACKAGES[*]}" | sed 's/ /, /g')" +# For all public changed workspaces for pkg_name in "${CHANGED_PACKAGES[@]}"; do - # Check for package-specific skip label + # skip if package-specific skip label is present if has_label "skip-changelog-$pkg_name"; then echo "⏩ Skipping changelog check for \`$pkg_name\` (label \`skip-changelog-$pkg_name\` present)." continue fi + # look for the changelog file CHANGELOG_FILE="packages/$pkg_name/changelogs/upcoming/$PR_NUMBER.md" if [ -f "$CHANGELOG_FILE" ]; then From 352b966859fad0b7abc334f79e27479443e3a951 Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Tue, 2 Dec 2025 18:29:52 +0100 Subject: [PATCH 09/10] chore: compare HEAD to parent only --- scripts/check_changelogs.sh | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/scripts/check_changelogs.sh b/scripts/check_changelogs.sh index b4d06df8725..35ea67fc631 100755 --- a/scripts/check_changelogs.sh +++ b/scripts/check_changelogs.sh @@ -1,6 +1,6 @@ #!/bin/bash -# This script checks that a changelog entry exists for every changed public package in a PR. +# Checks that a changelog entry exists for every changed public package in a PR. # # Skip logic: # @@ -10,16 +10,10 @@ set -e -# The Pull Request ID +# Pull request ID PR_NUMBER="$1" -# Pipe-separated list of labels applied to the PR +# Pipe-separated PR labels LABELS="$2" -# Remote name (defaults to `origin`) -REMOTE_NAME="origin" -# Target branch (defaults to `main`) -TARGET_BRANCH="${GITHUB_BASE_REF:-main}" -# Base ref to compare against (defaults to `origin/main`) -BASE_REF="$REMOTE_NAME/$TARGET_BRANCH" if [ -z "$PR_NUMBER" ]; then echo "Error: PR_NUMBER argument is missing." @@ -42,7 +36,7 @@ fi echo "🔍 Detecting changed public packages..." -CHANGED_FILES=$(git diff --name-only "$BASE_REF...HEAD") +CHANGED_FILES=$(git diff --name-only HEAD^1 HEAD) if [ -n "$CHANGED_FILES" ]; then echo "Changed files:" @@ -56,7 +50,7 @@ MISSING_CHANGELOGS=() for pkg_path in $(yarn workspaces list --json --no-private | jq -r '.location'); do pkg_name=$(basename "$pkg_path") - # we look for the package path in the changed files list + # look for the package path in the changed files list if echo "$CHANGED_FILES" | grep -Fq "$pkg_path/"; then CHANGED_PACKAGES+=("$pkg_name") fi @@ -67,7 +61,6 @@ if [ ${#CHANGED_PACKAGES[@]} -eq 0 ]; then exit 0 fi -# Comma-delimited list of changed packages echo "📦 Changed packages: $(echo "${CHANGED_PACKAGES[*]}" | sed 's/ /, /g')" # For all public changed workspaces From 52b3a4114a2d3b69677ea333eb10875b4f94567c Mon Sep 17 00:00:00 2001 From: Weronika Olejniczak Date: Tue, 2 Dec 2025 18:35:08 +0100 Subject: [PATCH 10/10] chore: use fetch depth 2 --- .github/workflows/changelog.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 13d255f1ae3..9ad52c937d5 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-slim steps: - uses: actions/checkout@v5 + with: + fetch-depth: 2 - name: Check changelogs run: | ./scripts/check_changelogs.sh \