Skip to content

ci: add CI workflow and branch deletion automation#10

Merged
oVitorio-ac merged 1 commit intomainfrom
development
Oct 10, 2025
Merged

ci: add CI workflow and branch deletion automation#10
oVitorio-ac merged 1 commit intomainfrom
development

Conversation

@oVitorio-ac
Copy link
Owner

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

  • Release
  • MTP (Move to Production)
  • MTS (Move to Staging)
  • DEV (Implement in Dev)

Description

...

Screenshots

  • Yes
  • No

How to Test

...

Dependencies

Checklist (Code Review)

  • Changes have a maximum of 400 lines.
  • I have performed a self-review of my own code.
  • Existing tests and linter pass locally with my changes.
  • I have commented my code in hard-to-understand areas (if applicable).
  • I have created tests for my fix or feature (if applicable).
  • Documentation has been updated to reflect the changes.
  • Business logic is correct and aligned with requirements.
  • Code quality meets established best practices and standards.
  • Tests are comprehensive, and all pass.
  • No security issues introduced by the changes.
  • Changes do not negatively impact system performance.
  • Documentation is clear and understandable.
  • Changes comply with established coding standards.
  • Constructive feedback has been provided on the code and proposed changes.

card-id

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.
@oVitorio-ac oVitorio-ac merged commit 4be30af into main Oct 10, 2025
4 checks passed
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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

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: read

No other changes, imports, or methods are needed for this fix.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,6 @@
 name: CI
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: CI
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant