Skip to content
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

Add bandit with ac commands and changelog track actions #1309

Closed
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
38 changes: 38 additions & 0 deletions .github/workflows/ac-bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: AC Bandit

on:
pull_request:
branches:
- dev
- staging*

jobs:
bandit:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Set up venv
run: |
python -m pip install --upgrade pip
pip install virtualenv
mkdir venv
virtualenv venv/venv-2.16

- name: Install dependencies
run: |
source venv/venv-2.16/bin/activate
python -m pip install --upgrade pip
pip install bandit

- name: Run ac-bandit
run: |
source venv/venv-2.16/bin/activate
./ac --ac-bandit --level l
47 changes: 47 additions & 0 deletions .github/workflows/changelog-track.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: New Changelog file

on:
pull_request:

jobs:
check-changelog:
permissions:
contents: read
runs-on: ubuntu-latest
env:
branch_name: ${{ github.event.pull_request.head.ref }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: ls base
run: |
cd changelogs/fragments/
{
echo "LS_BASE<<\n"
ls
echo "\n"
} >> "$GITHUB_ENV"

- name: Merge Changelogs
run: |
date > generated.txt
git config user.name github-actions
git config user.email [email protected]
git fetch
git checkout origin/"$branch_name" changelogs/fragments/

- name: ls all
run: |
cd changelogs/fragments/
{
echo "LS_ALL<<\n"
ls
echo "\n"
} >> "$GITHUB_ENV"

- name: Check for new file
run: |
[ "${#LS_ALL}" -gt "${#LS_BASE}" ] || (echo "No new changelog file was found" && exit 1)
Loading