-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (47 loc) · 1.81 KB
/
semver-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Rust Semver Checks
on:
pull_request_target:
branches:
- main
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
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: ${{ steps.filter.outputs.rust == 'true' || steps.override.outputs.out == 'true' }}
python: ${{ steps.filter.outputs.python == 'true' || steps.override.outputs.out == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Override label
id: override
run: |
echo "Label contains run-ci-checks: $OVERRIDE_LABEL"
if [ "$OVERRIDE_LABEL" == "true" ]; then
echo "Overriding due to label 'run-ci-checks'"
echo "out=true" >> $GITHUB_OUTPUT
elif [ "$DEFAULT_BRANCH" == "true" ]; then
echo "Overriding due to running on the default branch"
echo "out=true" >> $GITHUB_OUTPUT
fi
env:
OVERRIDE_LABEL: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}
DEFAULT_BRANCH: ${{ github.ref_name == github.event.repository.default_branch }}
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/change-filters.yml
rs-semver-checks:
needs: [changes]
if: ${{ needs.changes.outputs.rust == 'true' }}
uses: CQCL/hugrverse-actions/.github/workflows/rs-semver-checks.yml@main
with:
apt-dependencies: capnproto
secrets:
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }}