Skip to content

Commit

Permalink
Merge main into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
greenbonebot committed May 8, 2023
2 parents 7f301c8 + 58879d6 commit e84f03a
Show file tree
Hide file tree
Showing 24 changed files with 328 additions and 236 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "CodeQL"

on:
push:
branches: [ "main", v*, v2 ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '33 15 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
3 changes: 3 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Conventional Commits
on:
pull_request:

permissions:
pull-requests: write

jobs:
conventional-commits:
name: Report Conventional Commits
Expand Down
33 changes: 4 additions & 29 deletions admin-bypass/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,9 @@ branding:
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v4
id: python
with:
python-version: "3.10"
- name: Virtual Environment
- name: Set up Python and pontos
id: virtualenv
run: |
echo "path=${{ github.action_path }}/${{ github.action }}-venv" >> $GITHUB_OUTPUT
echo "name=${{ github.action }}-venv" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Virtual Environment
id: cache-virtualenv
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ steps.virtualenv.outputs.name }}
path: ${{ steps.virtualenv.outputs.path }}
- name: Create virtual environment
if: ${{ steps.cache-virtualenv.outputs.cache-hit != 'true' }}
run: |
python -m venv ${{ steps.virtualenv.outputs.path }}
shell: bash
- name: Install pontos
run: |
source ${{ steps.virtualenv.outputs.path }}/bin/activate
python -m pip install --upgrade pip
python -m pip install --upgrade pontos
wget https://github.com/greenbone/pontos/raw/main/scripts/github/enforce-admins.py -O ~/enforce-admins.py
shell: bash
uses: greenbone/actions/setup-pontos@v2
- name: allow/not allow bypass?
run: |
if [[ "${{inputs.allow}}" == "true" ]];
Expand All @@ -67,7 +41,8 @@ runs:
# in case of blubber input let the branch be unlocked!
- name: Prepare release and store the version
run: |
source ${{ steps.virtualenv.outputs.path }}/bin/activate
source ${{ steps.virtualenv.outputs.activate }}
wget https://github.com/greenbone/pontos/raw/main/scripts/github/enforce-admins.py -O ~/enforce-admins.py
pontos-github-script ~/enforce-admins.py ${{ inputs.repository }} ${{ inputs.branch }} ${{ env.ALLOW_OPT }}
shell: bash
env:
Expand Down
2 changes: 1 addition & 1 deletion backport-pull-request/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
- name: Set up Python and Poetry
uses: greenbone/actions/poetry@v2
with:
version: ${{ inputs.python-version }}
python-version: ${{ inputs.python-version }}
poetry-version: ${{ inputs.poetry-version }}
working-directory: ${{ github.action_path }}
without-dev: "true"
Expand Down
72 changes: 27 additions & 45 deletions backport-pull-request/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 4 additions & 27 deletions check-version/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,14 @@ runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
id: python
with:
python-version: ${{ inputs.python-version}}
- name: Virtual Environment
- name: Set up Python ${{ inputs.python-version }} and pontos
uses: actions/setup-pontos@v2
id: virtualenv
run: |
echo "path=${{ github.action_path }}/${{ github.action }}-venv" >> $GITHUB_OUTPUT
echo "name=${{ github.action }}-venv" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Virtual Environment
id: cache-virtualenv
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ steps.virtualenv.outputs.name }}
path: ${{ steps.virtualenv.outputs.path }}
- name: Create virtual environment
if: ${{ steps.cache-virtualenv.outputs.cache-hit != 'true' }}
run: |
python -m venv ${{ steps.virtualenv.outputs.path }}
shell: bash
- name: Install pontos
run: |
source ${{ steps.virtualenv.outputs.path }}/bin/activate
python -m pip install -U pip
python -m pip install pontos
shell: bash
python-version: ${{ inputs.python-version}}
- name: Check version information
run: |
source ${{ steps.virtualenv.outputs.path }}/bin/activate
source ${{ steps.virtualenv.outputs.activate }}
python -m pontos.version verify current
shell: bash
working-directory: ${{ inputs.working-directory }}
4 changes: 4 additions & 0 deletions conventional-commits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ name: Conventional Commits
on:
pull_request:

permissions:
pull-requests: write
contents: read

jobs:
conventional-commits:
name: Report Conventional Commits
Expand Down
2 changes: 1 addition & 1 deletion conventional-commits/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
- name: Set up Python and Poetry
uses: greenbone/actions/poetry@v2
with:
version: ${{ inputs.python-version }}
python-version: ${{ inputs.python-version }}
poetry-version: ${{ inputs.poetry-version }}
working-directory: ${{ github.action_path }}
without-dev: "true"
Expand Down
1 change: 1 addition & 0 deletions coverage-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ inputs:
deprecationMessage: "version input is deprecated. Please use `python-version` input instead."
python-version:
description: "Python version that should be installed"
default: "3.10"
test-command:
description: "Command to run the tests"
required: true
Expand Down
2 changes: 1 addition & 1 deletion download-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
- name: Set up Python and Poetry
uses: greenbone/actions/poetry@v2
with:
version: ${{ inputs.python-version }}
python-version: ${{ inputs.python-version }}
poetry-version: ${{ inputs.poetry-version }}
working-directory: ${{ github.action_path }}
without-dev: "true"
Expand Down
Loading

0 comments on commit e84f03a

Please sign in to comment.