Skip to content

Commit

Permalink
Corrected version of changed-files action
Browse files Browse the repository at this point in the history
  • Loading branch information
VisLab committed Oct 7, 2024
1 parent 6daf7c0 commit 3fba421
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/verify_source_branch.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,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."
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@v4
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

0 comments on commit 3fba421

Please sign in to comment.