-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify development #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2bc0363
Refactor Dockerfile and devcontainer.json for improved user setup and…
edfc5dd
Remove VS Code settings from .gitignore and add tasks.json for test a…
90e978b
Update postStartCommand to run tests after installing dependencies an…
c09f8ec
Add GitHub Actions workflow for creating draft releases
bf36077
Fix tag versioning logic to increment MINOR instead of PATCH
f743296
Separate postStartCommand and postAttachCommand for clearer execution…
e6cd6ac
Refactor environment variable definitions for pip in Dockerfile for i…
32573a1
Add GitHub Actions workflow for Python dependencies audit
510ec99
Update dependencies in requirements.txt for improved security and fun…
9539a3d
Remove unnecessary directory creation and ownership change in Dockerf…
c60116e
Potential fix for code scanning alert no. 9: Workflow does not contai…
Vianpyro 02c2134
Update draft-release.yml
Vianpyro 009ecc2
Add permissions section to workflow files for enhanced security
160a760
Refactor workflow files to simplify input handling and improve consis…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Create a Draft Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| inputs: | ||
| trigger_branch: | ||
| description: "Branch to monitor for changes" | ||
| default: "main" | ||
| required: false | ||
| file_filter_pattern: | ||
| description: "Regex to match changed files" | ||
| default: '^(?!tests/).*\.py$' | ||
| required: false | ||
|
|
||
| env: | ||
| TRIGGER_BRANCH: ${{ github.event.inputs.trigger_branch || 'main' }} | ||
| FILE_FILTER_PATTERN: ${{ github.event.inputs.file_filter_pattern || '^(?!tests/).*\.py$' }} | ||
|
|
||
| jobs: | ||
| create-release-draft: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code and fetch tags | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check for modified matching files | ||
| id: check_changes | ||
| run: | | ||
| echo "Trigger branch: $TRIGGER_BRANCH" | ||
| echo "File filter pattern: $FILE_FILTER_PATTERN" | ||
|
|
||
| git fetch origin $TRIGGER_BRANCH --depth=2 | ||
| MODIFIED=$(git diff --name-only HEAD^ HEAD) | ||
|
|
||
| echo "Modified files:" | ||
| echo "$MODIFIED" | ||
|
|
||
| MATCHING=$(echo "$MODIFIED" | grep -E "$FILE_FILTER_PATTERN" || true) | ||
|
|
||
| echo "Matching files:" | ||
| echo "$MATCHING" | ||
|
|
||
| if [[ -n "$MATCHING" ]]; then | ||
| echo "should_trigger=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "should_trigger=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Determine next tag version | ||
| id: version | ||
| run: | | ||
| LATEST=$(git tag --sort=-v:refname | head -n 1) | ||
| echo "Latest tag: $LATEST" | ||
|
|
||
| if [[ -z "$LATEST" ]]; then | ||
| NEXT_TAG="v0.0.1" | ||
| else | ||
| [[ "$LATEST" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)(-.+)?$ ]] | ||
| MAJOR=${BASH_REMATCH[1]} | ||
| MINOR=${BASH_REMATCH[2]} | ||
| PATCH=${BASH_REMATCH[3]} | ||
| SUFFIX=${BASH_REMATCH[4]} | ||
| MINOR=$((MINOR + 1)) | ||
| NEXT_TAG="v$MAJOR.$MINOR.$PATCH$SUFFIX" | ||
| fi | ||
|
|
||
| echo "Next tag: $NEXT_TAG" | ||
| echo "tag=$NEXT_TAG" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Create draft release | ||
| if: steps.check_changes.outputs.should_trigger == 'true' | ||
| run: | | ||
| curl -X POST \ | ||
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| https://api.github.com/repos/${{ github.repository }}/releases \ | ||
| -d '{ | ||
| "tag_name": "${{ steps.version.outputs.tag }}", | ||
| "target_commitish": "'"$TRIGGER_BRANCH"'", | ||
| "name": "${{ steps.version.outputs.tag }}", | ||
| "draft": true, | ||
| "prerelease": false, | ||
| "generate_release_notes": true | ||
| }' | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Python Dependencies Audit | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - requirements.txt | ||
| pull_request: | ||
| paths: | ||
| - requirements.txt | ||
| schedule: | ||
| - cron: '0 4 * * 1' # Every Monday at 4:00 UTC | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| pip-audit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.x' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pip-audit | ||
|
|
||
| - name: Run pip-audit | ||
| run: pip-audit -r requirements.txt | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "Run all tests", | ||
| "type": "shell", | ||
| "command": "python3 -m pytest tests", | ||
| "group": { | ||
| "kind": "test", | ||
| "isDefault": true | ||
| }, | ||
| "problemMatcher": [], | ||
| "runOptions": { | ||
| "runOn": "default" | ||
| } | ||
| }, | ||
| { | ||
| "label": "Run on test file", | ||
| "type": "shell", | ||
| "command": "python3 -m pytest '${relativeFile}' -v -x", | ||
| "group": { | ||
| "kind": "test", | ||
| }, | ||
| "problemMatcher": [], | ||
| "runOptions": { | ||
| "runOn": "default" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,11 +1,10 @@ | ||
| argon2-cffi>=23.1.0 | ||
| cryptography>=44.0.2 | ||
| Flask>=3.0.3 | ||
| Flask-JWT-Extended>=2.8.0 | ||
| Flask-Limiter>=3.7.0 | ||
| flask-cors>=4.0.1 | ||
| cryptography>=45.0.2 | ||
| Flask>=3.1.1 | ||
| Flask-JWT-Extended>=4.7.1 | ||
| Flask-Limiter>=3.12.0 | ||
| flask-cors>=6.0.0 | ||
| PyMySQL>=1.1.1 | ||
| requests>=2.32.3 | ||
| waitress>=3.0.0 | ||
| pytest>=8.3.5 | ||
| python-dotenv>=1.0.1 | ||
| python-dotenv>=1.1.0 | ||
| requests>=2.32.3 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.