Skip to content

API documentation update [apidoc] #148

API documentation update [apidoc]

API documentation update [apidoc] #148

# see https://github.com/marketplace/actions/github-action-for-creating-pull-requests
name: Update Python API Documentation
on:
push:
branches:
- apidoc-update-main
- apidoc-update-2023
jobs:
UpdatePythonApiDoc:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set target branch
id: target
run:
|
echo "Current branch: ${GITHUB_REF#refs/*/}"
if [[ ${GITHUB_REF#refs/*/} == "apidoc-update-main" ]]; then
TARGET_BRANCH="main"
elif [[ ${GITHUB_REF#refs/*/} == "apidoc-update-2023" ]]; then
TARGET_BRANCH="2023"
fi
echo "Target branch: ${TARGET_BRANCH}"
echo "target_branch=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
- name: Set reviewers
id: reviewers
run:
|
ALL_REVIEWERS="fblankenburgzeiss,mjauergom,mprinkezs"
CURR_REVIEWERS=$(echo "$ALL_REVIEWERS" | sed "s/${{ github.actor }}//g")
echo "Reviewers: ${CURR_REVIEWERS}"
echo "curr_reviewers=${CURR_REVIEWERS}" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
#source_branch: apidoc-update-main
target_branch: ${{ format('{0}', steps.target.outputs.target_branch) }}
title: ${{ format('Python API documentation update pull request ({0})', steps.target.outputs.target_branch) }}
#template: .github/PULL_REQUEST_TEMPLATE.md
body: "**Automated pull request**"
reviewer: ${{ format('{0}', steps.reviewers.outputs.curr_reviewers) }}
#assignee: octocat
label: documentation
#milestone: My milestone
#draft: true
#old_string: "<!-- Add your description here -->"
#new_string: "** Automatic pull request**"
get_diff: true
ignore_users: "dependabot"
allow_no_diff: false
- name: Mark as successful
# "Create Pull Request" fails if the PR already exists
if: always()
run: echo "RESULT=success" >> $GITHUB_OUTPUT