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 16, 2023
2 parents 31f46fb + af25719 commit 436ff0d
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 46 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: "CodeQL"
name: CodeQL

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

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:

permissions:
pull-requests: write
contents: read

jobs:
conventional-commits:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: 'Dependency Review'
on: [pull_request]
name: Dependency Review

on:
pull_request:

permissions:
contents: read
Expand All @@ -8,5 +10,5 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Dependency Review'
- name: Dependency Review
uses: greenbone/actions/dependency-review@v2
4 changes: 3 additions & 1 deletion .github/workflows/sbom-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: SBOM upload
on:
workflow_dispatch:
push:
branches: ["main"]
branches:
- main

jobs:
SBOM-upload:
runs-on: ubuntu-latest
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/test-doc-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ name: Test Doc Coverage Actions

on:
push:
tags: ["*"]
branches: [main]
paths: [ "doc-coverage-clang/**", ".github/workflows/test-doc-coverage.yml" ]
tags:
- "v*"
branches:
- main
paths:
- "doc-coverage-clang/**"
- ".github/workflows/test-doc-coverage.yml"
pull_request:
branches: [main]
paths: ["doc-coverage-clang/**", ".github/workflows/test-doc-coverage.yml"]
branches:
- main
paths:
- "doc-coverage-clang/**"
- ".github/workflows/test-doc-coverage.yml"

jobs:
test-doc-cov-clang:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test-download-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- "v*"
pull_request:

jobs:
Expand All @@ -15,12 +14,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Determine Branch
id: branch
run: |
if [ -n "$GITHUB_HEAD_REF" ];
then
echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV;
echo "branch=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT;
else
echo "BRANCH=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV;
echo "branch=${GITHUB_REF##refs/*/}" >> $GITHUB_OUTPUT;
fi;
shell: bash
- name: Trigger Artifact Uploading
Expand All @@ -29,29 +29,29 @@ jobs:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "test-download-artifacts-test-workflow.yml"
ref: ${{ env.BRANCH }}
ref: ${{ steps.branch.outputs.branch }}
- name: Download Artifact
uses: ./download-artifact
with:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "test-download-artifacts-test-workflow.yml"
branch: ${{ env.BRANCH }}
branch: ${{ steps.branch.outputs.branch }}
name: artifact
- name: Download Artifacts
uses: ./download-artifact
with:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "test-download-artifacts-test-workflow.yml"
branch: ${{ env.BRANCH }}
branch: ${{ steps.branch.outputs.branch }}
- name: Ignore missing workflow
uses: ./download-artifact
with:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "foo-bar.yml"
branch: ${{ env.BRANCH }}
branch: ${{ steps.branch.outputs.branch }}
name: artifact
allow-not-found: true
- name: Ignore missing artifact
Expand All @@ -60,6 +60,6 @@ jobs:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "test-download-artifacts-test-workflow.yml"
branch: ${{ env.BRANCH }}
branch: ${{ steps.branch.outputs.branch }}
name: foo
allow-not-found: true
4 changes: 2 additions & 2 deletions .github/workflows/test-hashsums.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Test Python Actions

on:
push:
tags: ["*"]
tags:
- "v*"
branches:
- main
- "v*"
pull_request:

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Test Python Actions

on:
push:
tags: [ "*" ]
tags:
- "v*"
branches:
- main
- "v*"
pull_request:

jobs:
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@ name: Test Release Actions

on:
push:
tags: [ "*" ]
branches: [ main ]
paths: [ "release/**","release-python/**", ".github/workflows/test-release.yml" ]
tags:
- "v*"
branches:
- main
paths:
- "release/**"
- "release-python/**"
- ".github/workflows/test-release.yml"
pull_request:
branches: [ main ]
paths: [ "release/**","release-python/**", ".github/workflows/test-release.yml" ]
branches:
- main
paths:
- "release/**"
- "release-python/**"
- ".github/workflows/test-release.yml"

jobs:
release-patch-cc:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-signature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Test Python Actions

on:
push:
tags: ["*"]
tags:
- "v*"
branches:
- main
- "v*"
pull_request:

jobs:
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/test-trigger-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- "v*"
pull_request:

jobs:
Expand All @@ -15,12 +14,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Determine Ref
id: ref
run: |
if [ -n "$GITHUB_HEAD_REF" ];
then
echo "REF=${GITHUB_HEAD_REF}" >> $GITHUB_ENV;
echo "ref=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT;
else
echo "REF=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV;
echo "ref=${GITHUB_REF##refs/*/}" >> $GITHUB_OUTPUT;
fi;
shell: bash
- name: Trigger Another Workflow
Expand All @@ -31,7 +31,7 @@ jobs:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "test-trigger-workflow-long-running-workflow.yml"
ref: ${{ env.REF }}
ref: ${{ steps.ref.outputs.ref }}
wait-for-completion-timeout: 10
wait-for-completion-interval: 10
- name: Fail if not failed
Expand All @@ -47,12 +47,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Determine Ref
id: ref
run: |
if [ -n "$GITHUB_HEAD_REF" ];
then
echo "REF=${GITHUB_HEAD_REF}" >> $GITHUB_ENV;
echo "ref=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT;
else
echo "REF=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV;
echo "ref=${GITHUB_REF##refs/*/}" >> $GITHUB_OUTPUT;
fi;
shell: bash
- name: Trigger Another Workflow
Expand All @@ -61,7 +62,7 @@ jobs:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "test-trigger-workflow-test-workflow.yml"
ref: ${{ env.REF }}
ref: ${{ steps.ref.outputs.ref }}
wait-for-completion-interval: 10

test-failing-workflow:
Expand All @@ -71,12 +72,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Determine Ref
id: ref
run: |
if [ -n "$GITHUB_HEAD_REF" ];
then
echo "REF=${GITHUB_HEAD_REF}" >> $GITHUB_ENV;
echo "ref=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT;
else
echo "REF=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV;
echo "ref=${GITHUB_REF##refs/*/}" >> $GITHUB_OUTPUT;
fi;
shell: bash
- name: Trigger Another Workflow
Expand All @@ -87,7 +89,7 @@ jobs:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: greenbone/actions
workflow: "test-trigger-workflow-failing-workflow.yml"
ref: ${{ env.REF }}
ref: ${{ steps.ref.outputs.ref }}
- name: Fail if not failed
if: ${{ success() && steps.test.outcome != 'failure' }}
run: |
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Run unittests

on:
push:
tags:
- "v*"
branches:
- main
pull_request:

jobs:
run-backport-pull-request-tests:
runs-on: ubuntu-latest
name: Run unit tests for backport-pull-request action
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup project
uses: greenbone/actions/poetry@v2
with:
working-directory: backport-pull-request
- name: Run unit tests
run: poetry run python -m unittest
working-directory: backport-pull-request
9 changes: 5 additions & 4 deletions mypy-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ description: "An action that verifies python type hints by using mypy"
inputs:
packages:
description: "Python packages to check with mypy"
deprecationMessage: "packages input is deprecated. Please use `mypy-arguments` input instead."
required: true
version:
description: "Python version that should be installed. Deprecated: Use `python-version` input instead."
deprecationMessage: "version input is deprecated. Please use `python-version` input instead."
mypy-arguments:
description: "Additional arguments for running mypy"
default: ""
python-version:
description: "Python version that should be installed"
default: "3.10"
Expand All @@ -32,15 +36,12 @@ runs:
- name: Install poetry
uses: greenbone/actions/poetry@v2
with:
version: ${{ inputs.version }}
python-version: ${{ inputs.python-version }}
poetry-version: ${{ inputs.poetry-version }}
cache: ${{ inputs.cache }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}
cache-poetry-installation: ${{ inputs.cache-poetry-installation }}
- run: echo "Running mypy"
shell: bash
- run: poetry run mypy ${{ inputs.packages }}
- run: poetry run mypy ${{ inputs.mypy-arguments }} ${{ inputs.packages }}
shell: bash
name: Check with mypy
working-directory: ${{ github.workspace }}

0 comments on commit 436ff0d

Please sign in to comment.