diff --git a/.github/workflows/automatic_doc_generation.yml b/.github/workflows/automatic_doc_generation.yml new file mode 100644 index 0000000000..ca87359d93 --- /dev/null +++ b/.github/workflows/automatic_doc_generation.yml @@ -0,0 +1,46 @@ +name: "Automatic doc generation" +on: + pull_request: + branches: + - main + - develop + +jobs: + generate-docs: + runs-on: ubuntu-latest + env: + isPR: ${{ github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'main' }} + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + poetry install + + - name: Generate docs + run: python splunk_add_on_ucc_framework/generators/doc_generator.py + + - name: Import GPG key + if: ${{ env.isPR }} + uses: crazy-max/ghaction-import-gpg@v6 + with: + git_committer_name: ${{ secrets.SA_GH_USER_NAME }} + git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }} + gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.SA_GPG_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + - name: Push updated screenshots + if: ${{ env.isPR }} + run: | + git add \*.md + git diff --staged --exit-code || (git commit -S -m "doc: updated docs regarding generated conf, xml and html files" && git push) + \ No newline at end of file diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index a74bcfcbb5..ea27584acd 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -87,7 +87,8 @@ jobs: with: node-version: ${{ matrix.node-version }} - storybook-screenshots: + bot-updates: + steps: name: Update storybook screenshots permissions: contents: write @@ -95,6 +96,11 @@ jobs: uses: ./.github/workflows/storybook-visual.yml with: node-version: "20" + name: Generates Documentation + permissions: + contents: write + uses: ./.github/workflows/automatic_doc_generation.yml + build: needs: @@ -326,7 +332,7 @@ jobs: - test-smoke - test-ui - build-test-addon-openapi-client - - storybook-screenshots + - bot-updates runs-on: ubuntu-latest env: NEEDS: ${{ toJson(needs) }} diff --git a/tests/unit/test_server_conf.py b/tests/unit/test_server_conf.py index e7bf841b19..164c537676 100644 --- a/tests/unit/test_server_conf.py +++ b/tests/unit/test_server_conf.py @@ -1,7 +1,7 @@ import os import tempfile -from splunk_add_on_ucc_framework import server_conf as server_conf_lib +from splunk_add_on_ucc_framework import server_conf as server_conf_lib # type: ignore[attr-defined] from tests.unit import helpers