Skip to content

Commit dfcfdee

Browse files
committed
feat: Update execution-env-publish.yml to enhance rebuild logic
- Added a new filter for `rebuild_all` to trigger builds when specific files change. - Improved conditional checks to determine when to build all images based on workflow changes. - Filtered out `rebuild_all` from the changes list for cleaner output.
1 parent 07a82c1 commit dfcfdee

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/execution-env-publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
id: changes
3030
with:
3131
filters: |
32+
rebuild_all:
33+
- '.github/workflows/execution-env-publish.yml'
34+
- 'docker/entrypoint.sh'
3235
python:
3336
- 'docker/python.Dockerfile'
3437
- 'docker/repl_server.py'
@@ -57,11 +60,14 @@ jobs:
5760
run: |
5861
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ github.event.inputs.build_all }}" == "true" ]; then
5962
echo 'languages=${{ env.ALL_LANGUAGES }}' >> $GITHUB_OUTPUT
60-
elif [ "${{ github.event_name }}" == "push" ] && [ "${{ contains(github.event.head_commit.modified, '.github/workflows/execution-env-publish.yml') }}" == "true" ]; then
61-
# If workflow itself changed, build everything
63+
elif [ "${{ steps.changes.outputs.rebuild_all }}" == "true" ]; then
64+
# If workflow or shared files changed, build everything
6265
echo 'languages=${{ env.ALL_LANGUAGES }}' >> $GITHUB_OUTPUT
6366
else
64-
echo "languages=${{ steps.changes.outputs.changes }}" >> $GITHUB_OUTPUT
67+
# Filter out rebuild_all from the changes list
68+
CHANGES='${{ steps.changes.outputs.changes }}'
69+
FILTERED=$(echo "$CHANGES" | jq -c '[.[] | select(. != "rebuild_all")]')
70+
echo "languages=$FILTERED" >> $GITHUB_OUTPUT
6571
fi
6672
6773
build-images:

0 commit comments

Comments
 (0)