ci: add CI workflow and branch deletion automation#10
Merged
oVitorio-ac merged 1 commit intomainfrom Oct 10, 2025
Merged
Conversation
Add GitHub Actions workflows for continuous integration testing and automated deletion of merged branches. The CI workflow includes steps for Python setup, dependency installation with Poetry, running tests, and linting with Black, isort, and detect-secrets. The branch deletion workflow removes merged branches upon PR closure.
Comment on lines
+11
to
+34
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.13' | ||
| - name: Install Poetry | ||
| run: | | ||
| curl -sSL https://install.python-poetry.org | python3 - | ||
| echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
| - name: Install dependencies | ||
| run: | | ||
| poetry config virtualenvs.create false | ||
| poetry install --with dev | ||
| - name: Install pytest | ||
| run: poetry add --group dev pytest | ||
| - name: Run tests | ||
| run: poetry run pytest | ||
| - name: Run linting | ||
| run: | | ||
| poetry run black --check . | ||
| poetry run isort --check-only . | ||
| poetry run detect-secrets scan No newline at end of file |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
The best way to fix the problem is to explicitly set a least-privilege permissions block at the root level of the workflow file (.github/workflows/ci.yml). Since the job shown only reads repository contents (for checkout and installing dependencies), and does not push code, publish releases, or interact with pull requests/issues, it only requires read access to the contents. Thus, add the following at the top (under the name: line, before on:):
permissions:
contents: readNo other changes, imports, or methods are needed for this fix.
Suggested changeset
1
.github/workflows/ci.yml
| @@ -1,4 +1,6 @@ | ||
| name: CI | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
Copilot is powered by AI and may make mistakes. Always verify output.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add GitHub Actions workflows for continuous integration testing and automated deletion of merged branches. The CI workflow includes steps for Python setup, dependency installation with Poetry, running tests, and linting with Black, isort, and detect-secrets. The branch deletion workflow removes merged branches upon PR closure.
PULL REQUEST FOR card-id
Type
Description
...
Screenshots
How to Test
...
Dependencies
Yes
No
Dependencies
Checklist (Code Review)
card-id