diff --git a/.github/workflows/validate-companies.yml b/.github/workflows/validate-companies.yml index 71e6c3ecd..74f9fc1ec 100644 --- a/.github/workflows/validate-companies.yml +++ b/.github/workflows/validate-companies.yml @@ -44,7 +44,15 @@ jobs: - name: Get changed files id: changed run: | - FILES=$(gh pr diff ${{ github.event.pull_request.number }} --name-only | grep -E '(^src/companies/.*\.md$|^company-profiles/)' || true) + # List changed files via the API rather than `gh pr diff --name-only`, + # so we can filter on each file's status. A PR that renames or deletes + # a company profile reports the old path too, and that path does not + # exist in the pr-head checkout — validating it failed with ENOENT and + # blocked the PR on a file it had legitimately removed. + FILES=$(gh api \ + "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" \ + --paginate -q '.[] | select(.status != "removed") | .filename' \ + | grep -E '(^src/companies/.*\.md$|^company-profiles/)' || true) echo "files<> "$GITHUB_OUTPUT" echo "$FILES" >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" @@ -64,8 +72,22 @@ jobs: MAPPED_FILES=() while IFS= read -r f; do [ -z "$f" ] && continue + # Belt and braces: the status filter above should mean every path + # here exists, so warn rather than skip silently if one does not. + if [ ! -f "pr-head/$f" ]; then + echo "::warning::Skipping $f — not present in the PR checkout" + continue + fi MAPPED_FILES+=("pr-head/$f") done <<< "$CHANGED_FILES" + if [ ${#MAPPED_FILES[@]} -eq 0 ]; then + echo "No company files to validate." + echo "json<> "$GITHUB_OUTPUT" + echo '{"oldFormatFiles":[],"files":{},"summary":{"total":0,"passed":0,"failed":0,"warnings":0}}' >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + echo "exit_code=0" >> "$GITHUB_OUTPUT" + exit 0 + fi RESULT=$(node .github/scripts/validate-companies.js "${MAPPED_FILES[@]}") EXIT_CODE=$? set -e diff --git a/package-lock.json b/package-lock.json index 3685e2d20..fec0b63a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "remote-in-tech", - "version": "4.13.5", + "version": "4.13.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "remote-in-tech", - "version": "4.13.5", + "version": "4.13.6", "license": "ISC", "dependencies": { "@11ty/eleventy": "^3.1.6", diff --git a/package.json b/package.json index 7cca56aa4..08e1a9b3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remote-in-tech", - "version": "4.13.5", + "version": "4.13.6", "description": "A list of semi to fully remote-friendly companies in or around tech", "author": "Doug Aitken", "license": "ISC", diff --git a/src/_data/changelog.json b/src/_data/changelog.json index c01914f1b..d368d83f5 100644 --- a/src/_data/changelog.json +++ b/src/_data/changelog.json @@ -1,4 +1,15 @@ [ + { + "version": "4.13.6", + "date": "2026-09-07", + "summary": "Fixed the company validation workflow blocking any PR that renames or removes a profile", + "changes": [ + { + "type": "fixed", + "description": "The Validate Company Profiles workflow built its file list from gh pr diff --name-only, which reports both the old and new path when a PR renames a company profile. The old path no longer exists in the PR checkout, so validation died with ENOENT and blocked the PR over a file it had legitimately deleted — the same failure hit any PR removing a profile. The workflow now lists changed files through the API and filters out removed entries, so only files actually present get validated." + } + ] + }, { "version": "4.13.5", "date": "2026-09-07",