-
Notifications
You must be signed in to change notification settings - Fork 11
46 lines (37 loc) · 1.22 KB
/
verify_source_branch.yaml
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
name: Verify source branch name
on:
pull_request:
branches:
- '**'
jobs:
verify-source-branch:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref }} # Set the variables used by the verify_branch script
VALIDATE_ALL: "True"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Print source branch name
run: |
echo "The source branch of the PR is: $BRANCH_NAME"
- name: Get latest push changes
id: changed-files
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Pre-commit
run: pip install pre-commit
- name: Install dependencies
run: pip install git+https://github.com/hed-standard/hed-python.git@develop
- name: Run pre-commit on changed files
run: |
if [ -n "${{ steps.changed-files.outputs.all_changed_files }}" ]; then
pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }}
else
echo "No files have changed, skipping pre-commit."
fi