From aac2bbf2015684457815978bb90a8abe52b6fe07 Mon Sep 17 00:00:00 2001 From: IsaacVRey Date: Tue, 19 Mar 2024 10:37:59 -0600 Subject: [PATCH 1/2] Create bandit github action using the ac command --- .github/workflows/ac-bandit.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ac-bandit.yml diff --git a/.github/workflows/ac-bandit.yml b/.github/workflows/ac-bandit.yml new file mode 100644 index 000000000..288fb92b1 --- /dev/null +++ b/.github/workflows/ac-bandit.yml @@ -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 From 5ed415be93db32193cc52dde3b5a441d4a5466ed Mon Sep 17 00:00:00 2001 From: IsaacVRey Date: Tue, 19 Mar 2024 14:32:03 -0600 Subject: [PATCH 2/2] Add changelog track action --- .github/workflows/changelog-track.yml | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/changelog-track.yml diff --git a/.github/workflows/changelog-track.yml b/.github/workflows/changelog-track.yml new file mode 100644 index 000000000..b998d33e6 --- /dev/null +++ b/.github/workflows/changelog-track.yml @@ -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 github-actions@github.com + 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)