Skip to content

Stop GitHub Actions from trying to build scripts/Dockerfile.codespace #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
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
26 changes: 9 additions & 17 deletions .github/workflows/build-push-codespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,18 @@ jobs:
else
# Otherwise auto-diff HEAD^ → HEAD for any changed top-level dirs
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
CHANGED_DIRS=$(echo "$CHANGED_FILES" \
| awk -F/ '{print $1}' \
| sort -u \
| grep -v '^$')
ALL_PROJECT_DIRS=$(find . -maxdepth 1 -type d \
-not -path '*/\.*' \
-not -path '.' \
| sed 's|^\./||' \
| grep -v '^_')
CHANGED_DIRS=$(echo "$CHANGED_FILES" | grep -o "^[^/]*" | sort -u | grep -v "^$")
ALL_PROJECT_DIRS=$(find . -maxdepth 1 -type d -not -path "*/\.*" -not -path "." | sed 's|^\./||' | grep -vE "^(scripts|_).*$")
PROJECTS="["
sep=""
for d in $CHANGED_DIRS; do
if echo "$ALL_PROJECT_DIRS" | grep -qx "$d"; then
PROJECTS+="${sep}\"$d\""
sep=","
COMMA=""
for DIR in $CHANGED_DIRS; do
if echo "$ALL_PROJECT_DIRS" | grep -q "^$DIR$"; then
PROJECTS="${PROJECTS}${COMMA}\"${DIR}\""
COMMA=","
fi
done
PROJECTS+="]"
PROJECTS="${PROJECTS}]"
fi

echo "matrix=$PROJECTS" >> $GITHUB_OUTPUT
echo "Projects to build: $PROJECTS"

Expand Down Expand Up @@ -111,7 +103,7 @@ jobs:
- name: Generate Dockerfile.codespace
id: generate-dockerfile
run: |
python scripts/generate_codespace_dockerfile.py "${{ matrix.project }}"
python ./scripts/generate_codespace_dockerfile.py "${{ matrix.project }}"
echo "Generated Dockerfile.codespace for ${{ matrix.project }}"

- name: Create Pull Request for new Dockerfile
Expand Down
Loading