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 12, 2023
2 parents 351eca7 + a907c74 commit 0bedae8
Show file tree
Hide file tree
Showing 24 changed files with 576 additions and 215 deletions.
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,68 @@ updates:
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/poetry/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/release/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/release-python/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/coverage-python/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/lint-python/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/mypy-python/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/mattermost-notify/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/install-npm/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/lint-javascript/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
- package-ecosystem: "github-actions"
directory: "/test-javascript/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"

# PIP
- package-ecosystem: pip
Expand All @@ -55,6 +77,8 @@ updates:
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "Deps"
- package-ecosystem: pip
directory: "/download-artifact/"
schedule:
Expand All @@ -63,6 +87,8 @@ updates:
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "Deps"
- package-ecosystem: pip
directory: "/backport-pull-request/"
schedule:
Expand All @@ -71,3 +97,5 @@ updates:
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "Deps"
106 changes: 23 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,18 @@

Repository that contains a collection of GitHub Actions for Greenbone projects

## Language specific CI actions
## Language specific Actions

We offer several actions for linting, formatting, building and testing packages/modules/projects in different programming languages

### Python

```yml
- name: Install python and poetry and the project
uses: greenbone/actions/poetry@v2
with:
version: 3.9

- name: Install python, poetry, project and run coverage
uses: greenbone/actions/coverage-python@v2
with:
version: 3.9

- name: Install python, poetry, project and run lint
uses: greenbone/actions/lint-python@v2
with:
version: 3.9
```
* [Install python, poetry and the project](https://github.com/greenbone/actions/tree/v2/poetry)
* [Install python, poetry, project and run coverage to create a code coverage report](https://github.com/greenbone/actions/tree/v2/coverage-python)
* [Install python, poetry, project and run pylint linter](https://github.com/greenbone/actions/tree/v2/lint-python)
* [Install python, poetry, project and and run mypy type checker](https://github.com/greenbone/actions/tree/v2/mypy-python)
* [Install python, poetry, build python package and upload it to PyPI](https://github.com/greenbone/actions/tree/v2/pypi-upload)
* [Setup python and pontos](https://github.com/greenbone/actions/tree/v2/setup-pontos)

### JavaScript

Expand Down Expand Up @@ -67,58 +57,24 @@ We offer several actions for linting, formatting, building and testing packages/
uses: greenbone/actions/doc-coverage-clang@v2
```
## Branch protection
```yml
- name: lock <target> branch on <repository>
uses: greenbone/actions/lock-branch@v2
with:
lock: "true"
github-token: ${{ token }}
branch: <target>
repository: <repository>
- name: unlock <target> branch on <repository>
uses: greenbone/actions/lock-branch@v2
with:
lock: "false"
github-token: ${{ token }}
branch: <target>
repository: <repository>
- name: allow admin users bypassing protection on <target> branch on <repository>
uses: greenbone/actions/admin-bypass@v2
with:
allow: "true"
github-token: ${{ token }}
branch: <target>
repository: <repository>
- name: disable bypassing protection on <target> branch on <repository> for admin users
uses: greenbone/actions/admin-bypass@v2
with:
allow: "false"
github-token: ${{ token }}
branch: <target>
repository: <repository>
```
## Language independent Actions
### Branch protection
## Other useful actions
* [Lock and unlock a branch in a GitHub repository](https://github.com/greenbone/actions/tree/v2/lock-branch)
* [Allow and disallow admin users bypassing protection rules](https://github.com/greenbone/actions/tree/v2/admin-bypass)
Release a project in C, GoLang, JavaScript or Python
### Other useful actions
```yml
- name: Run release actions
uses: greenbone/actions/release@v2
with:
github-user: ${{ secrets.FOO_BAR }}
github-user-mail: foo@bar.baz
github-user-token: bar
gpg-key: boo
gpg-passphrase: foo
gpg-fingerprint: baz
release-type: calendar
ref: main
```
* [Release a project in C, GoLang, JavaScript or Python](https://github.com/greenbone/actions/tree/v2/release)
* [Create and upload signatures for GitHub release files](https://github.com/greenbone/actions/tree/v2/sign-release-files)
* [Report usage of conventional commits in a Pull Request](https://github.com/greenbone/actions/tree/v2/conventional-commits)
* [Check for consistent versioning in a project](https://github.com/greenbone/actions/tree/v2/check-version)
* [Backport Pull Requests to other additional branches](https://github.com/greenbone/actions/tree/v2/backport-pull-request)
* [Workflow notifications in Mattermost channels](https://github.com/greenbone/actions/tree/v2/mattermost-notify)
* [Trigger Workflow Runs](https://github.com/greenbone/actions/tree/v2/trigger-workflow)
* [Download Workflow Artifacts from a different workflow or even repository](https://github.com/greenbone/actions/tree/v2/trigger-workflow)
Update licence header supporting many different filetypes
Update license header supporting many different filetypes
```yml
- name: Run update header
Expand Down Expand Up @@ -148,25 +104,9 @@ SHA256 file or GPG signature generation
file: ./foo/bar
```
Check for consistent versioning in a project
```yml
- name: Check versioning
uses: greenbone/actions/check-version@v2
```
Report Conventional Commits
```yml
- name: Check conventional commits
uses: greenbone/actions/conventional-commits@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
```
## Support
For any question on the usage of python-gvm please use the
For any question on the usage of the Greenbone actions please use the
[Greenbone Community Forum](https://forum.greenbone.net/). If you
found a problem with the software, please
[create an issue](https://github.com/greenbone/actions/issues)
Expand All @@ -178,6 +118,6 @@ This project is maintained by [Greenbone AG](https://www.greenbone.net/).
## License
Copyright (C) 2020-2022 [Greenbone AG](https://www.greenbone.net/)
Copyright (C) 2020-2023 [Greenbone AG](https://www.greenbone.net/)
Licensed under the [GNU General Public License v3.0 or later](LICENSE).
40 changes: 40 additions & 0 deletions admin-bypass/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Admin bypass Action

GitHub Action that allows or disallows repository admins to bypass branch
protection rules.

## Examples

```yml
name: Bypass Branch Protection

on:
push:

jobs:
lock:
name: Bypass Protection
runs-on: ubuntu-latest
steps:
- name: allow admin users bypassing protection on <target> branch on <repository>
uses: greenbone/actions/admin-bypass@v2
with:
allow: "true"
branch: <target>
repository: <repository>
- name: disable bypassing protection on <target> branch on <repository> for admin users
uses: greenbone/actions/admin-bypass@v2
with:
allow: "false"
branch: <target>
repository: <repository>
```
## Action Configuration
|Input Variable|Description| |
|--------------|-----------|-|
| github-token | Github user token, that is legitimated to bypass branch protection. | Optional (default: `${{ github.token }}`) |
| allow | Allow or not? (Options: `"true"`, `"false"`)? | Optional (default is `"false"`) |
| repository | What repository branch should be able to be bypassed by admins? Defaults to the executing repository. | Optional (default is `${{ github.repository }}` |
| branch | Target branch for the bypass. | Optional (default is `"main"`) |
2 changes: 2 additions & 0 deletions backport-pull-request/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

GitHub Action to backport pull requests.

## Examples

To run this action you need to add the following code to your workflow file
(for example `.github/workflows/backport.yml`):

Expand Down
18 changes: 9 additions & 9 deletions backport-pull-request/poetry.lock

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

27 changes: 27 additions & 0 deletions check-version/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Check Version

GitHub Action to check version information of a project via pontos

## Example

```yml
name: Check Versioning

on:
push:
pull_request:

jobs:
check:
name: Check Versioning
runs-on: ubuntu-latest
steps:
- uses: greenbone/actions/check-version@v2
```
## Action Configuration
|Input Variable|Description| |
|--------------|-----------|-|
| python-version | Python version to use for running the action. | Optional (default is `3.10`) |
| working-directory | "A working directory where to check the versioning | Optional (default is `${{ github.workspace }}`) |
Loading

0 comments on commit 0bedae8

Please sign in to comment.