xref: /llvm-project/.github/workflows/version-check.yml (revision a0971f027caab9714271bcb2457aa7d419a90a45)
1name: LLVM Project Version Check
2
3on:
4  push:
5    branches:
6      - 'release/**'
7  pull_request:
8    branches:
9      - 'release/**'
10
11permissions:
12  contents: read
13
14jobs:
15  version_check:
16    if: github.repository_owner == 'llvm'
17    runs-on: ubuntu-latest
18    steps:
19      - name: Fetch LLVM sources
20        uses: actions/checkout@v4
21        with:
22          fetch-depth: 0
23
24      - name: Install dependencies
25        run: |
26          pip install --require-hashes -r ./llvm/utils/git/requirements.txt
27
28      - name: Version Check
29        run: |
30          version=$(grep -o 'LLVM_VERSION_\(MAJOR\|MINOR\|PATCH\) [0-9]\+' cmake/Modules/LLVMVersion.cmake  | cut -d ' ' -f 2 | tr "\n" "." | sed 's/.$//g')
31          .github/workflows/version-check.py "$version"
32