-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrected version of changed-files action
- Loading branch information
Showing
1 changed file
with
45 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |