Skip to content

Add selective CI triggering based on changed files.#18

Merged
woblerr merged 6 commits intomasterfrom
refactor_ci
Feb 23, 2026
Merged

Add selective CI triggering based on changed files.#18
woblerr merged 6 commits intomasterfrom
refactor_ci

Conversation

@woblerr
Copy link
Owner

@woblerr woblerr commented Feb 22, 2026

Add detect_changes job to workflows to skip build_image when no relevant files are changed.

Uses tj-actions/changed-files@v47.0.4 (pinned to SHA 7dee1b0c) with fetch-depth: 0 for full git history.

build_image runs only when:

  • project-specific Dockerfiles are modified;
  • common scripts are modified (entrypoint.sh, start_gpdb.sh);
  • the workflow file itself is modified;
  • push to master or a tag push;

Add `detect_changes` job using tj-actions/changed-files@v47.0.4
(pinned to SHA 7dee1b0c1557f278e5c7dc244927139d78c0e22a) to skip
`build_image` when no relevant files are changed.
`build_image` now runs only when:
- docker/greenplum/**/6/** files are modified
- docker/files/entrypoint.sh or docker/files/start_gpdb.sh are modified
- .github/workflows/build-gpdb6.yml is modified
- push to master or a tag is pushed
@woblerr woblerr self-assigned this Feb 22, 2026
@woblerr woblerr added the enhancement New feature or request label Feb 22, 2026
@woblerr woblerr requested a review from Copilot February 22, 2026 15:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds selective CI triggering to avoid unnecessary Docker image builds when unrelated files change. A detect_changes job now runs before build_image to determine if relevant files were modified, and build_image only executes when project-specific files, common scripts, the workflow itself, or pushes to master/tags occur.

Changes:

  • Added detect_changes job using tj-actions/changed-files@v47.0.4 (pinned to SHA) to detect file changes
  • Modified build_image job to depend on detect_changes and conditionally run based on changed files or branch/tag
  • Applied identical pattern across all seven workflow files (gpdb6/7, greengage6/7, opengpdb6, warehousepg6/7)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/workflows/build-warehousepg7.yml Added change detection for warehousepg version 7 files
.github/workflows/build-warehousepg6.yml Added change detection for warehousepg version 6 files
.github/workflows/build-opengpdb6.yml Added change detection for opengpdb version 6 files with opengpdb-specific script path
.github/workflows/build-greengage7.yml Added change detection for greengage version 7 files
.github/workflows/build-greengage6.yml Added change detection for greengage version 6 files
.github/workflows/build-gpdb7.yml Added change detection for greenplum version 7 files
.github/workflows/build-gpdb6.yml Added change detection for greenplum version 6 files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if [[ "${{ steps.changed-files.outputs.project_any_changed }}" == "true" || \
"${{ steps.changed-files.outputs.common_any_changed }}" == "true" || \
"${{ github.ref }}" == "refs/heads/master" || \
"${{ github.ref }}" == refs/tags/* ]]; then
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs/tags/* pattern is not quoted in the shell comparison. This will cause the glob pattern to be expanded by the shell instead of being treated as a literal string for comparison. Add quotes around 'refs/tags/*' to match the pattern correctly.

Suggested change
"${{ github.ref }}" == refs/tags/* ]]; then
"${{ github.ref }}" == "refs/tags/*" ]]; then

Copilot uses AI. Check for mistakes.
if [[ "${{ steps.changed-files.outputs.project_any_changed }}" == "true" || \
"${{ steps.changed-files.outputs.common_any_changed }}" == "true" || \
"${{ github.ref }}" == "refs/heads/master" || \
"${{ github.ref }}" == refs/tags/* ]]; then
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs/tags/* pattern is not quoted in the shell comparison. This will cause the glob pattern to be expanded by the shell instead of being treated as a literal string for comparison. Add quotes around 'refs/tags/*' to match the pattern correctly.

Suggested change
"${{ github.ref }}" == refs/tags/* ]]; then
"${{ github.ref:0:10 }}" == "refs/tags/" ]]; then

Copilot uses AI. Check for mistakes.
if [[ "${{ steps.changed-files.outputs.project_any_changed }}" == "true" || \
"${{ steps.changed-files.outputs.common_any_changed }}" == "true" || \
"${{ github.ref }}" == "refs/heads/master" || \
"${{ github.ref }}" == refs/tags/* ]]; then
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs/tags/* pattern is not quoted in the shell comparison. This will cause the glob pattern to be expanded by the shell instead of being treated as a literal string for comparison. Add quotes around 'refs/tags/*' to match the pattern correctly.

Suggested change
"${{ github.ref }}" == refs/tags/* ]]; then
"${{ github.ref }}" == "refs/tags/*" ]]; then

Copilot uses AI. Check for mistakes.
if [[ "${{ steps.changed-files.outputs.project_any_changed }}" == "true" || \
"${{ steps.changed-files.outputs.common_any_changed }}" == "true" || \
"${{ github.ref }}" == "refs/heads/master" || \
"${{ github.ref }}" == refs/tags/* ]]; then
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs/tags/* pattern is not quoted in the shell comparison. This will cause the glob pattern to be expanded by the shell instead of being treated as a literal string for comparison. Add quotes around 'refs/tags/*' to match the pattern correctly.

Suggested change
"${{ github.ref }}" == refs/tags/* ]]; then
"${{ github.ref }}" == 'refs/tags/*' ]]; then

Copilot uses AI. Check for mistakes.
if [[ "${{ steps.changed-files.outputs.project_any_changed }}" == "true" || \
"${{ steps.changed-files.outputs.common_any_changed }}" == "true" || \
"${{ github.ref }}" == "refs/heads/master" || \
"${{ github.ref }}" == refs/tags/* ]]; then
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs/tags/* pattern is not quoted in the shell comparison. This will cause the glob pattern to be expanded by the shell instead of being treated as a literal string for comparison. Add quotes around 'refs/tags/*' to match the pattern correctly.

Copilot uses AI. Check for mistakes.
if [[ "${{ steps.changed-files.outputs.project_any_changed }}" == "true" || \
"${{ steps.changed-files.outputs.common_any_changed }}" == "true" || \
"${{ github.ref }}" == "refs/heads/master" || \
"${{ github.ref }}" == refs/tags/* ]]; then
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs/tags/* pattern is not quoted in the shell comparison. This will cause the glob pattern to be expanded by the shell instead of being treated as a literal string for comparison. Add quotes around 'refs/tags/*' to match the pattern correctly.

Suggested change
"${{ github.ref }}" == refs/tags/* ]]; then
"${{ github.ref }}" == "refs/tags/"* ]]; then

Copilot uses AI. Check for mistakes.
if [[ "${{ steps.changed-files.outputs.project_any_changed }}" == "true" || \
"${{ steps.changed-files.outputs.common_any_changed }}" == "true" || \
"${{ github.ref }}" == "refs/heads/master" || \
"${{ github.ref }}" == refs/tags/* ]]; then
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs/tags/* pattern is not quoted in the shell comparison. This will cause the glob pattern to be expanded by the shell instead of being treated as a literal string for comparison. Add quotes around 'refs/tags/*' to match the pattern correctly.

Copilot uses AI. Check for mistakes.
@woblerr woblerr merged commit fa14429 into master Feb 23, 2026
66 checks passed
@woblerr woblerr deleted the refactor_ci branch February 23, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants