Skip to content

Commit

Permalink
ci: update workflow calls
Browse files Browse the repository at this point in the history
  • Loading branch information
hetangmodi-crest committed Jul 31, 2024
1 parent cd48a8c commit 2a152a0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
71 changes: 36 additions & 35 deletions .github/workflows/automatic_doc_generation.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
name: "Automatic doc generation"
on:
pull_request:
branches:
- main
- develop
workflow_call:
inputs:
python-version:
required: true
type: string

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
- uses: actions/checkout@v4
with:
lfs: true
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- 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: 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: Generate docs
run: |
python splunk_add_on_ucc_framework/generators/doc_generator.py
- name: Importing 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)
- name: Importing 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)
3 changes: 2 additions & 1 deletion .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ jobs:
permissions:
contents: write
uses: ./.github/workflows/automatic_doc_generation.yml

with:
python-version: "3.7"

build:
needs:
Expand Down

0 comments on commit 2a152a0

Please sign in to comment.