diff --git a/.github/actions/complete-pr-comment/action.yaml b/.github/actions/complete-pr-comment/action.yaml index 1ecabd30..0e8488b2 100644 --- a/.github/actions/complete-pr-comment/action.yaml +++ b/.github/actions/complete-pr-comment/action.yaml @@ -1,7 +1,8 @@ name: "Complete PR Comment" -description: - "Removes the 'eyes' reaction and adds a completion reaction ('rocket' for success, 'confused' for 'failure', 'cancelled', or 'skipped') to the - triggering comment." +description: >- + Removes the 'eyes' reaction and adds a completion reaction ('rocket' for success, 'confused' for 'failure', + 'cancelled', or 'skipped') to the triggering comment. Requires `issues: write` permission in the calling + workflow to update comment reactions via the GitHub Reactions API. inputs: status: description: diff --git a/.github/actions/workflow-setup/action.yaml b/.github/actions/workflow-setup/action.yaml index 619f911f..89a27321 100644 --- a/.github/actions/workflow-setup/action.yaml +++ b/.github/actions/workflow-setup/action.yaml @@ -29,6 +29,9 @@ inputs: exclude-globs: description: "Exclude globs for change detection" required: false + head-ref: + description: "Explicit head ref for change detection (overrides the resolved ref)" + required: false outputs: is_act: @@ -119,3 +122,4 @@ runs: file-type: ${{ inputs.file-type }} include-globs: ${{ inputs.include-globs }} exclude-globs: ${{ inputs.exclude-globs }} + head-ref: ${{ inputs.head-ref }} diff --git a/.github/workflows/actionlint-check.yaml b/.github/workflows/actionlint-check.yaml index 418ff03e..52742693 100644 --- a/.github/workflows/actionlint-check.yaml +++ b/.github/workflows/actionlint-check.yaml @@ -62,11 +62,16 @@ jobs: .github/workflows/**/*.yaml .github/actions/**/*.yml .github/actions/**/*.yaml + head-ref: ${{ inputs.pr-head-sha }} actionlint-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && ( + github.event_name == 'workflow_dispatch' || + inputs.skip-relevance-check || + needs.setup.outputs.has_changes == 'true' + ) runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/clang-format-check.yaml b/.github/workflows/clang-format-check.yaml index 38478df1..f385f740 100644 --- a/.github/workflows/clang-format-check.yaml +++ b/.github/workflows/clang-format-check.yaml @@ -35,7 +35,7 @@ jobs: clang-format-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && (github.event_name == 'workflow_dispatch' || needs.setup.outputs.has_changes == 'true') runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/clang-format-fix.yaml b/.github/workflows/clang-format-fix.yaml index aec93000..c47bd782 100644 --- a/.github/workflows/clang-format-fix.yaml +++ b/.github/workflows/clang-format-fix.yaml @@ -52,6 +52,7 @@ run-name: "${{ github.actor }} fixing C++ code format" permissions: pull-requests: write contents: write + issues: write jobs: setup: diff --git a/.github/workflows/clang-tidy-check.yaml b/.github/workflows/clang-tidy-check.yaml index b3cf3db3..74eeb4ea 100644 --- a/.github/workflows/clang-tidy-check.yaml +++ b/.github/workflows/clang-tidy-check.yaml @@ -47,7 +47,7 @@ jobs: clang-tidy-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && (github.event_name == 'workflow_dispatch' || needs.setup.outputs.has_changes == 'true') runs-on: ubuntu-24.04 container: image: ghcr.io/framework-r-d/phlex-ci:latest diff --git a/.github/workflows/cmake-build.yaml b/.github/workflows/cmake-build.yaml index a9da769e..87299cfb 100644 --- a/.github/workflows/cmake-build.yaml +++ b/.github/workflows/cmake-build.yaml @@ -102,6 +102,7 @@ jobs: pr-base-sha: ${{ inputs.pr-base-sha }} checkout-path: ${{ inputs.checkout-path }} build-path: ${{ inputs.build-path }} + head-ref: ${{ inputs.pr-head-sha }} file-type: | cpp cmake @@ -123,7 +124,11 @@ jobs: build: needs: [setup, generate-matrix] if: > - always() && needs.setup.result == 'success' && needs.setup.outputs.has_changes == 'true' + always() && needs.setup.result == 'success' && ( + github.event_name == 'workflow_dispatch' || + inputs.skip-relevance-check || + needs.setup.outputs.has_changes == 'true' + ) runs-on: ubuntu-24.04 strategy: fail-fast: false diff --git a/.github/workflows/cmake-format-check.yaml b/.github/workflows/cmake-format-check.yaml index 2ddc0a96..190e803d 100644 --- a/.github/workflows/cmake-format-check.yaml +++ b/.github/workflows/cmake-format-check.yaml @@ -58,11 +58,16 @@ jobs: uses: Framework-R-D/phlex/.github/actions/workflow-setup@main with: file-type: cmake + head-ref: ${{ inputs.pr-head-sha }} cmake-format-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && ( + github.event_name == 'workflow_dispatch' || + inputs.skip-relevance-check || + needs.setup.outputs.has_changes == 'true' + ) runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.github/workflows/cmake-format-fix.yaml b/.github/workflows/cmake-format-fix.yaml index a0d2ed18..0894b150 100644 --- a/.github/workflows/cmake-format-fix.yaml +++ b/.github/workflows/cmake-format-fix.yaml @@ -52,6 +52,7 @@ run-name: "${{ github.actor }} fixing CMake format" permissions: pull-requests: write contents: write + issues: write jobs: setup: diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 2ec4b508..60d7a6d3 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -63,7 +63,7 @@ jobs: coverage: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && (github.event_name == 'workflow_dispatch' || needs.setup.outputs.has_changes == 'true') runs-on: ubuntu-24.04 container: image: ghcr.io/framework-r-d/phlex-ci:latest diff --git a/.github/workflows/header-guards-check.yaml b/.github/workflows/header-guards-check.yaml index 1ce24729..24f695df 100644 --- a/.github/workflows/header-guards-check.yaml +++ b/.github/workflows/header-guards-check.yaml @@ -58,11 +58,16 @@ jobs: uses: Framework-R-D/phlex/.github/actions/workflow-setup@main with: file-type: cpp + head-ref: ${{ inputs.pr-head-sha }} header-guards-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && ( + github.event_name == 'workflow_dispatch' || + inputs.skip-relevance-check || + needs.setup.outputs.has_changes == 'true' + ) runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/header-guards-fix.yaml b/.github/workflows/header-guards-fix.yaml index 8584bc77..05935630 100644 --- a/.github/workflows/header-guards-fix.yaml +++ b/.github/workflows/header-guards-fix.yaml @@ -52,6 +52,7 @@ run-name: "${{ github.actor }} fixing header guards" permissions: pull-requests: write contents: write + issues: write jobs: setup: diff --git a/.github/workflows/jsonnet-format-check.yaml b/.github/workflows/jsonnet-format-check.yaml index 0695f6df..ffed5e07 100644 --- a/.github/workflows/jsonnet-format-check.yaml +++ b/.github/workflows/jsonnet-format-check.yaml @@ -58,11 +58,16 @@ jobs: uses: Framework-R-D/phlex/.github/actions/workflow-setup@main with: file-type: jsonnet + head-ref: ${{ inputs.pr-head-sha }} jsonnet-format-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && ( + github.event_name == 'workflow_dispatch' || + inputs.skip-relevance-check || + needs.setup.outputs.has_changes == 'true' + ) runs-on: ubuntu-latest container: image: public.ecr.aws/bitnami/jsonnet:latest diff --git a/.github/workflows/jsonnet-format-fix.yaml b/.github/workflows/jsonnet-format-fix.yaml index 82822c1e..88c1df42 100644 --- a/.github/workflows/jsonnet-format-fix.yaml +++ b/.github/workflows/jsonnet-format-fix.yaml @@ -52,6 +52,7 @@ run-name: "${{ github.actor }} fixing Jsonnet format" permissions: pull-requests: write contents: write + issues: write jobs: setup: diff --git a/.github/workflows/markdown-check.yaml b/.github/workflows/markdown-check.yaml index 2c0a94e6..1102fd5f 100644 --- a/.github/workflows/markdown-check.yaml +++ b/.github/workflows/markdown-check.yaml @@ -58,11 +58,16 @@ jobs: uses: Framework-R-D/phlex/.github/actions/workflow-setup@main with: file-type: md + head-ref: ${{ inputs.pr-head-sha }} markdown-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && ( + github.event_name == 'workflow_dispatch' || + inputs.skip-relevance-check || + needs.setup.outputs.has_changes == 'true' + ) runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/markdown-fix.yaml b/.github/workflows/markdown-fix.yaml index 3e9c6c99..424a8138 100644 --- a/.github/workflows/markdown-fix.yaml +++ b/.github/workflows/markdown-fix.yaml @@ -52,6 +52,7 @@ run-name: "${{ github.actor }} fixing Markdown format" permissions: pull-requests: write contents: write + issues: write jobs: setup: diff --git a/.github/workflows/python-check.yaml b/.github/workflows/python-check.yaml index aae6d5a4..e5bb900f 100644 --- a/.github/workflows/python-check.yaml +++ b/.github/workflows/python-check.yaml @@ -58,11 +58,16 @@ jobs: uses: Framework-R-D/phlex/.github/actions/workflow-setup@main with: file-type: python + head-ref: ${{ inputs.pr-head-sha }} python-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && ( + github.event_name == 'workflow_dispatch' || + inputs.skip-relevance-check || + needs.setup.outputs.has_changes == 'true' + ) runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/python-fix.yaml b/.github/workflows/python-fix.yaml index 43c13153..5c676556 100644 --- a/.github/workflows/python-fix.yaml +++ b/.github/workflows/python-fix.yaml @@ -52,6 +52,7 @@ run-name: "${{ github.actor }} fixing Python code" permissions: pull-requests: write contents: write + issues: write jobs: setup: diff --git a/.github/workflows/yaml-check.yaml b/.github/workflows/yaml-check.yaml index be9cad9d..05c41ed2 100644 --- a/.github/workflows/yaml-check.yaml +++ b/.github/workflows/yaml-check.yaml @@ -34,7 +34,7 @@ jobs: yaml-check: needs: setup if: > - always() && needs.setup.outputs.has_changes == 'true' + always() && (github.event_name == 'workflow_dispatch' || needs.setup.outputs.has_changes == 'true') runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.github/workflows/yaml-fix.yaml b/.github/workflows/yaml-fix.yaml index 6916cdc4..b20e2257 100644 --- a/.github/workflows/yaml-fix.yaml +++ b/.github/workflows/yaml-fix.yaml @@ -52,6 +52,7 @@ name: YAML Fix permissions: pull-requests: write contents: write + issues: write jobs: setup: