diff --git a/.github/workflows/clang-format-check.yaml b/.github/workflows/clang-format-check.yaml index 599147739..c999aa740 100644 --- a/.github/workflows/clang-format-check.yaml +++ b/.github/workflows/clang-format-check.yaml @@ -49,7 +49,7 @@ jobs: clang-format-check: needs: detect-clang-format-changes - if: ${{ needs.detect-clang-format-changes.outputs.has_changes == 'true' }} + if: ${{ (needs.detect-clang-format-changes.outputs.has_changes == 'true') || (github.event_name == 'workflow_dispatch') || (env.ACT == 'true') }} runs-on: ubuntu-latest permissions: contents: read @@ -69,7 +69,7 @@ jobs: clang-format-check-skipped: needs: detect-clang-format-changes - if: ${{ needs.detect-clang-format-changes.outputs.has_changes != 'true' }} + if: ${{ (needs.detect-clang-format-changes.outputs.has_changes != 'true') && (github.event_name != 'workflow_dispatch') && (env.ACT != '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 47e616b0f..477d311b6 100644 --- a/.github/workflows/clang-format-fix.yaml +++ b/.github/workflows/clang-format-fix.yaml @@ -48,6 +48,7 @@ jobs: path: phlex-src ref: ${{ needs.check.outputs.ref_name }} repository: ${{ needs.check.outputs.repo_name }} + token: ${{ secrets.WORKFLOW_PAT }} - uses: DoozyX/clang-format-lint-action@bcb4eb2cb0d707ee4f3e5cc3b456eb075f12cf73 # v0.20 with: @@ -59,6 +60,7 @@ jobs: - uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 id: add_and_commit with: + token: ${{ secrets.WORKFLOW_PAT }} cwd: phlex-src author_name: "github-actions[bot]" author_email: "41898282+github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/clang-tidy-check.yaml b/.github/workflows/clang-tidy-check.yaml index 3ad7bde27..86e78ca61 100644 --- a/.github/workflows/clang-tidy-check.yaml +++ b/.github/workflows/clang-tidy-check.yaml @@ -94,7 +94,8 @@ jobs: needs: [ detect-clang-tidy-changes, check_comment_trigger ] if: | (github.event_name == 'pull_request' && needs.detect-clang-tidy-changes.outputs.has_changes == 'true') || - (github.event_name == 'issue_comment' && needs.check_comment_trigger.outputs.match_result == 'match' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'OWNER')) + (github.event_name == 'issue_comment' && needs.check_comment_trigger.outputs.match_result == 'match' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'OWNER')) || + (github.event_name == 'workflow_dispatch') || (env.ACT == 'true') runs-on: ubuntu-24.04 container: @@ -187,7 +188,7 @@ jobs: clang-tidy-check-skipped: needs: detect-clang-tidy-changes - if: github.event_name == 'pull_request' && needs.detect-clang-tidy-changes.outputs.has_changes != 'true' + if: github.event_name == 'pull_request' && (needs.detect-clang-tidy-changes.outputs.has_changes != 'true') && (github.event_name != 'workflow_dispatch') && (env.ACT != 'true') runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/clang-tidy-fix.yaml b/.github/workflows/clang-tidy-fix.yaml index 40ab85338..a92969d64 100644 --- a/.github/workflows/clang-tidy-fix.yaml +++ b/.github/workflows/clang-tidy-fix.yaml @@ -64,6 +64,7 @@ jobs: path: phlex-src ref: ${{ needs.check.outputs.ref_name }} repository: ${{ needs.check.outputs.repo_name }} + token: ${{ secrets.WORKFLOW_PAT }} - name: Setup build environment uses: Framework-R-D/phlex/.github/actions/setup-build-env@main @@ -96,6 +97,7 @@ jobs: uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 id: add_and_commit with: + token: ${{ secrets.WORKFLOW_PAT }} cwd: phlex-src author_name: "github-actions[bot]" author_email: "41898282+github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/cmake-format-check.yaml b/.github/workflows/cmake-format-check.yaml index f91a4fbf7..2ce49d2ef 100644 --- a/.github/workflows/cmake-format-check.yaml +++ b/.github/workflows/cmake-format-check.yaml @@ -49,7 +49,7 @@ jobs: cmake-format-check: needs: detect-cmake-format-changes - if: ${{ needs.detect-cmake-format-changes.outputs.has_changes == 'true' }} + if: ${{ (needs.detect-cmake-format-changes.outputs.has_changes == 'true') || (github.event_name == 'workflow_dispatch') || (env.ACT == 'true') }} runs-on: ubuntu-latest steps: @@ -98,7 +98,7 @@ jobs: cmake-format-check-skipped: needs: detect-cmake-format-changes - if: ${{ needs.detect-cmake-format-changes.outputs.has_changes != 'true' }} + if: ${{ (needs.detect-cmake-format-changes.outputs.has_changes != 'true') && (github.event_name != 'workflow_dispatch') && (env.ACT != 'true') }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/cmake-format-fix.yaml b/.github/workflows/cmake-format-fix.yaml index d03a2223b..fc4563899 100644 --- a/.github/workflows/cmake-format-fix.yaml +++ b/.github/workflows/cmake-format-fix.yaml @@ -49,6 +49,7 @@ jobs: path: phlex-src ref: ${{ needs.check.outputs.ref_name }} repository: ${{ needs.check.outputs.repo_name }} + token: ${{ secrets.WORKFLOW_PAT }} - name: Set up Python uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6 @@ -81,6 +82,7 @@ jobs: uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 id: add_and_commit with: + token: ${{ secrets.WORKFLOW_PAT }} cwd: phlex-src author_name: "github-actions[bot]" author_email: "41898282+github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index c608d2b27..8923ab5cd 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -30,8 +30,8 @@ jobs: packages: read outputs: - has_changes: ${{ steps.act_force.outputs.matched == 'true' && 'true' || steps.filter.outputs.matched }} - changed_files: ${{ steps.act_force.outputs.matched == 'true' && steps.act_force.outputs.matched_files || steps.filter.outputs.matched_files }} + has_changes: ${{ steps.filter.outputs.matched }} + changed_files: ${{ steps.filter.outputs.matched_files }} steps: - name: Check out source code @@ -40,25 +40,8 @@ jobs: fetch-depth: 0 path: phlex-src - - name: Detect act environment - id: detect_act - run: | - if [ "${GITHUB_ACTOR}" = "nektos/act" ] || [ "${ACT:-}" = "true" ] || [ "${ACT:-}" = "1" ]; then - echo "is_act=true" >> "$GITHUB_OUTPUT" - else - echo "is_act=false" >> "$GITHUB_OUTPUT" - fi - - - name: Force coverage execution when running under act - id: act_force - if: ${{ steps.detect_act.outputs.is_act == 'true' }} - run: | - echo "matched=true" >> "$GITHUB_OUTPUT" - echo "matched_files=act-run: forced coverage execution" >> "$GITHUB_OUTPUT" - - name: Detect coverage relevant changes id: filter - if: ${{ steps.detect_act.outputs.is_act != 'true' }} uses: Framework-R-D/phlex/.github/actions/detect-relevant-changes@main with: repo-path: phlex-src @@ -69,29 +52,18 @@ jobs: cmake - name: Report detection outcome - env: - IS_ACT: ${{ steps.detect_act.outputs.is_act }} - ACT_MATCHED: ${{ steps.act_force.outputs.matched }} - ACT_FILES: ${{ steps.act_force.outputs.matched_files }} - FILTER_MATCHED: ${{ steps.filter.outputs.matched }} - FILTER_FILES: ${{ steps.filter.outputs.matched_files }} run: | - if [ "${IS_ACT}" = "true" ]; then - echo "::notice::Running under act; forcing coverage workflow to execute." - if [ -n "${ACT_FILES}" ]; then - printf '%s\n' "${ACT_FILES}" - fi - elif [ "${FILTER_MATCHED}" != "true" ]; then + if [ "${{ steps.filter.outputs.matched }}" != "true" ]; then echo "::notice::No coverage relevant changes detected; workflow will be skipped." else echo "::group::Coverage relevant files" - printf '%s\n' "${FILTER_FILES}" + printf '%s\n' "${{ steps.filter.outputs.matched_files }}" echo "::endgroup::" fi coverage: needs: detect-coverage-changes - if: ${{ needs.detect-coverage-changes.outputs.has_changes == 'true' }} + if: ${{ (needs.detect-coverage-changes.outputs.has_changes == 'true') || (github.event_name == 'workflow_dispatch') || (env.ACT == 'true') }} runs-on: ubuntu-24.04 container: @@ -366,7 +338,7 @@ jobs: coverage-skipped: needs: detect-coverage-changes - if: ${{ needs.detect-coverage-changes.outputs.has_changes != 'true' }} + if: ${{ (needs.detect-coverage-changes.outputs.has_changes != 'true') && (github.event_name != 'workflow_dispatch') && (env.ACT != 'true') }} runs-on: ubuntu-latest permissions: contents: read