-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (42 loc) · 1.65 KB
/
process-pull-request.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Pull Request Checker
on:
pull_request_target:
branches:
- '**'
- '!mainline'
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Run tests
run: |
/usr/bin/pip3 install gitPython
python -c "import sys; import git; print(sys.version)"
git fetch origin ${{ github.base_ref }}
if ! git fetch origin ${{ github.head_ref }}; then
echo "Unable to checkout ${{ github.head_ref }}"
else
git checkout -b ${{ github.head_ref }} origin/${{ github.head_ref }}
git checkout ${{ github.base_ref }}
fi
# git remote add linux https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
# git fetch --shallow-since="3 years ago" linux
echo "Will run process-git-request.py with:"
echo "fname = ${{ github.run_id }}"
echo "target_branch = ${{ github.base_ref }}"
echo "source_branch = ${{ github.head_ref }}"
echo "prj_dir = ${{ github.workspace }}"
echo "pull_request = ${{ github.ref }}"
echo "requestor = ${{ github.actor }}"
cd ${{ github.workspace }}
/usr/bin/python3 .github/workflows/process-git-request.py ${{ github.run_id }} ${{ github.base_ref }} \
${{ github.ref }} ${{ github.workspace }} ${{ github.head_ref }} ${{ github.actor }}