From 6113f3d70f24cf95e72b71409ea153eacad7b029 Mon Sep 17 00:00:00 2001 From: Iulia Moldovan Date: Tue, 28 Jun 2022 10:22:53 +0100 Subject: [PATCH] action: Add workflow for github action to run check_guideline.py Signed-off-by: Iulia Moldovan --- .../workflows/check_for_guideline_rules.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/check_for_guideline_rules.yml diff --git a/.github/workflows/check_for_guideline_rules.yml b/.github/workflows/check_for_guideline_rules.yml new file mode 100644 index 000000000..bd2a78f53 --- /dev/null +++ b/.github/workflows/check_for_guideline_rules.yml @@ -0,0 +1,38 @@ +name: Guideline checker + +on: + pull_request: + branches: + - master + paths: + - 'library/**' + - 'projects/**' + +jobs: + guideline_check: + runs-on: ubuntu-latest + + steps: + - name: Setup python + uses: actions/setup-python@v4 + with: + # version range + python-version: '3.x' + - name: Checkout repository code + uses: actions/checkout@v3 + # repository that retrieves all the changed files + - name: Load get-changed-files repo + uses: Ana06/get-changed-files@v1.2 + id: changed_files + with: + format: space-delimited + - name: Print changed files + run: | + echo "Changed files:" + echo "${{ steps.changed_files.outputs.all }}" + - name: Execute py script for guideline check + id: execution + # -p flag means that files will be specified with their relative path + run: | + python ./.github/scripts/check_guideline.py -p ${{ steps.changed_files.outputs.all }} + shell: sh