Skip to content

Commit

Permalink
run all ci checks when the PR has a label set
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Jun 3, 2024
1 parent b369bff commit b44aa3e
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,39 @@ jobs:
# Check if changes were made to the relevant files.
# Always returns true if running on the default branch, to ensure all changes are throughly checked.
changes:
name: Check for changes in Rust files
name: Check for changes
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
# These outputs are always true when running after a merge to main, or if the PR has a `run-ci-checks` label.
outputs:
rust: ${{ github.ref_name == github.event.repository.default_branch || steps.filter.outputs.rust }}
python: ${{ github.ref_name == github.event.repository.default_branch || steps.filter.outputs.python }}
rust: steps.filter.outputs.rust || steps.override.outputs.out
python: steps.filter.outputs.python || steps.override.outputs.out
steps:
- uses: actions/checkout@v4
- name: Override label
id: override
run: |
if [ "${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}" == "true" ]; then
echo "Overriding due to label 'run-ci-checks'"
echo "out=true" >> $GITHUB_OUTPUT
elif [ "${{ github.ref_name == github.event.repository.default_branch }}" == "true" ]; then
echo "Overriding due to running on the default branch"
echo "out=true" >> $GITHUB_OUTPUT
fi
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/change-filters.yml
- name: Debug output
run: |
echo "Rust: ${{ steps.filter.outputs.rust }}"
echo "Python: ${{ steps.filter.outputs.python }}"
echo "Override: ${{ steps.override.outputs.out }}"
echo "Final Rust: ${{ steps.override.outputs.out || steps.filter.outputs.rust }}"
echo "Final Python: ${{ steps.override.outputs.out || steps.filter.outputs.python }}"
check-rs:
name: Check Rust code 🦀
Expand Down

0 comments on commit b44aa3e

Please sign in to comment.