Skip to content

Commit 0adc256

Browse files
DEVOPS-65 added workflow
1 parent f7d5ba7 commit 0adc256

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: publish-confluence-pages-programatically
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
action:
6+
description: 'create or update or append or delete confluence page'
7+
type: choice
8+
options:
9+
- create
10+
- update
11+
- append
12+
- delete
13+
required: true
14+
confluence_space:
15+
description: 'confluencce space'
16+
default: 'devwithkrishna'
17+
required: true
18+
type: string
19+
confluence_page_title:
20+
description: 'heading of confluence page'
21+
required: true
22+
type: string
23+
markdown_file_path:
24+
description: 'markdown path and file name'
25+
default: 'README.md'
26+
type: string
27+
required: true
28+
jobs:
29+
publish-confluence-pages-programatically:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Git checkout
33+
uses: actions/checkout@v4
34+
- name: set up python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.10'
38+
- name: poetry installation
39+
run: |
40+
pip install poetry
41+
poetry install --no-dev
42+
- name: Execute python program
43+
env:
44+
CONFLUENCE_URL : ${{ secrets.CONFLUENCE_URL }}
45+
CONFLUENCE_USERNAME: ${{ secrets.CONFLUENCE_USERNAME }}
46+
CONFLUENCE_PASSWORD: ${{ secrets.CONFLUENCE_PASSWORD }}
47+
run: |
48+
poetry run python3 confluence.py --confluence_space devwithkrishna \
49+
--confluence_page_title "This is test" \
50+
--action update --markdown_file_path README.md
51+
- name: program execution completed
52+
run: echo "program execution completed"

confluence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def main():
156156
""" To test the script"""
157157
parser = argparse.ArgumentParser(description='Process arguments for the program')
158158
parser.add_argument("--action", type=str, choices=['create','update','append','delete'], help='Possble actions', required=True)
159-
parser.add_argument("--confluence_space", type=str, help='Confluencce space', required=True)
159+
parser.add_argument("--confluence_space", type=str, help='Confluence space', required=True)
160160
parser.add_argument("--confluence_page_title", type=str, help='Confluence page title', required=True)
161161
parser.add_argument("--markdown_file_path", type=str, help='Markdown file path with file name', required=True)
162162

0 commit comments

Comments
 (0)