From ac97b5b8e5fd37ae5abb404ecd4ee3eef4bd1e09 Mon Sep 17 00:00:00 2001 From: "Felix Exner (fexner)" Date: Wed, 27 Sep 2023 22:24:25 +0200 Subject: [PATCH] Add Github action (#23) * Added action.yml This allows this repo being used as a GH action in other projects. Signed-off-by: Felix Exner * Added README entry about GitHub action Explain how to use this tool inside a github workflow and checked the tick for a github action on the feature list. Signed-off-by: Felix Exner --------- Signed-off-by: Felix Exner Co-authored-by: Christian Henkel <6976069+ct2034@users.noreply.github.com> --- README.md | 16 +++++++++++++++- action.yml | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 action.yml diff --git a/README.md b/README.md index d06d309..f23effa 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,20 @@ optional arguments: -q, --quiet disable most output ``` +### Using it as a GitHub action +You can use `ros_license_toolkit` inside your GitHub workflow in order to check licenses in your +repository in each pull request. Use the following job inside your workflow file: + +```yaml +jobs: + check_licenses: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: boschresearch/ros_license_toolkit@1.1.5 +``` + ## State of Development *WORK IN PROGRESS* This is currently working and feature complete to the point it was originally intended. @@ -86,7 +100,7 @@ In particular, the following things will have to be done: - [x] Allow license name in tag to be also full name of SPDX key. - [x] Each LicenseTag should have SPDX id. - [ ] Single license tag without file attribute and single license text should match automatically. -- [ ] Turn into github action. +- [x] Turn into github action. ## License ros_license_toolkit is open-sourced under the Apache-2.0 license. See the diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..c8f7463 --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +name: ros_license_tool +description: Runs the ros_license_tool on the ROS packages from a repo + +runs: + using: composite + steps: + - name: Install Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install package + run: pip install $GITHUB_ACTION_PATH + shell: bash + - name: Run ros_license_toolkit linter + run: ros_license_toolkit . + shell: bash