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
24 changes: 23 additions & 1 deletion .github/workflows/validate-companies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF" >> "$GITHUB_OUTPUT"
echo "$FILES" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
Expand All @@ -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<<EOF" >> "$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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
11 changes: 11 additions & 0 deletions src/_data/changelog.json
Original file line number Diff line number Diff line change
@@ -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 <code>Validate Company Profiles</code> workflow built its file list from <code>gh pr diff --name-only</code>, 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 <code>ENOENT</code> 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 <code>removed</code> entries, so only files actually present get validated."
}
]
},
{
"version": "4.13.5",
"date": "2026-09-07",
Expand Down
Loading