Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
42 changes: 41 additions & 1 deletion .github/workflows/pr-00-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,33 @@ concurrency:
cancel-in-progress: true

jobs:
detect:
name: classify changed paths
runs-on: ubuntu-latest
outputs:
is_docs_only: ${{ steps.classify.outputs.is-docs-only || 'false' }}
is_python_code: ${{ steps.classify.outputs.is-python-code || 'true' }}
is_workflow_change: ${{ steps.classify.outputs.is-workflow-change || 'false' }}
is_security_relevant: ${{ steps.classify.outputs.is-security-relevant || 'true' }}
classification_rationale: ${{ steps.classify.outputs.classification-rationale || 'path classifier unavailable' }}
Comment on lines +45 to +49
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Classify changed paths
id: classify
uses: ./.github/actions/path-classifier
with:
force-full: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'verify:full') || github.event_name == 'schedule' }}

python-ci:
name: Python CI
needs: detect
if: >-
${{
needs.detect.outputs.is_docs_only != 'true' &&
needs.detect.outputs.is_python_code == 'true'
}}
uses: stranske/Workflows/.github/workflows/reusable-10-ci-python.yml@main
with:
python-versions: '["3.12", "3.13"]'
Expand All @@ -53,7 +78,7 @@ jobs:

summary:
name: gate-summary
needs: [python-ci]
needs: [detect, python-ci]
if: ${{ always() }}
runs-on: ubuntu-latest
permissions:
Expand All @@ -74,6 +99,7 @@ jobs:
- name: Summarize results
id: summarize
env:
DETECT_RESULT: ${{ needs.detect.result || 'skipped' }}
PYTHON_RESULT: ${{ needs.python-ci.result || 'skipped' }}
run: |
set -euo pipefail
Expand Down Expand Up @@ -105,6 +131,20 @@ jobs:
;;
esac

detect_result="${DETECT_RESULT:-skipped}"
if [[ "${detect_result}" != "success" ]]; then
if [[ "${detect_result}" == "failure" ]]; then
state="failure"
description="Path classification failed"
elif [[ "${detect_result}" == "cancelled" ]]; then
state="error"
description="Path classification was cancelled"
else
state="pending"
description="Path classification status unknown"
fi
fi

echo "state=${state}" >> "$GITHUB_OUTPUT"
echo "description=${description}" >> "$GITHUB_OUTPUT"
echo "[Gate] State: ${state}, Description: ${description}"
Expand Down
Loading