-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (58 loc) · 2.21 KB
/
create-pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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