Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,39 @@ on:
branches: [main]
pull_request:
branches: [main]
paths:
- 'plox/**'

jobs:
check_modified:
name: Check modified code files
outputs:
detected_changed_src: ${{ steps.check_files.outputs.detected_changed_src }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: check for modified code src files
id: check_files
run: |
echo "=============== list modified files ==============="
git diff --name-only HEAD^ HEAD

echo "========== check paths of modified files =========="
git diff --name-only HEAD^ HEAD > files.txt
while IFS= read -r file
do
echo $file
if [[ $file == plox/* ]]; then
echo "Detected src code under plox/ modified!"
echo "detected_changed_src=true" >> "$GITHUB_OUTPUT"
return
fi
done < files.txt
echo "detected_changed_src=false" >> "$GITHUB_OUTPUT"
scan:
needs: check_modified
if: needs.check_modified.outputs.detected_changed_src == 'true'
runs-on: ubuntu-latest
permissions:
# required for all workflows
Expand Down
37 changes: 14 additions & 23 deletions .github/workflows/ensure-version-changed.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
name: VERSION bump
name: VERSION

on:
pull_request:

jobs:
changed_files:
check_version_modified:
runs-on: ubuntu-latest
name: validate
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Base SHA
id: base-sha
run: echo "sha=$(git rev-parse origin/${{ github.event.repository.default_branch }})" >> $GITHUB_OUTPUT

- name: Ensure VERSION file has been updated.
id: changed-version-file
uses: tj-actions/changed-files@v44
with:
base_sha: "${{ steps.base-sha.outputs.sha }}"
files_yaml: |
version:
- VERSION

- name: Fail if VERSION file wasn't detected as changed
if: steps.changed-version-file.outputs.version_any_changed == 'false'
fetch-depth: 2
- name: check for modified code src files
id: check_files
run: |
echo "=> Did not detect VERISON file has been updated."
echo "=> Updated the VERSION file, commit, and re-push."
echo "=============== list modified files ==============="
git diff --name-only HEAD^ HEAD > files.txt
cat files.txt
echo "========== check paths of modified files =========="
while IFS= read -r file; do
if [[ $file == VERSION ]]; then
exit 0
fi
done < files.txt
exit 1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
rev: v0.11.0
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.0.2
56 changes: 28 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading