Skip to content

Commit

Permalink
change(npm): without global install, add package-lock.json
Browse files Browse the repository at this point in the history
  • Loading branch information
tomassebestik committed Sep 6, 2024
1 parent 08467b8 commit 97968da
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 13 deletions.
17 changes: 5 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
ref: change/composite-action

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -37,20 +37,13 @@ runs:
shell: bash

- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ~/.npm/_cacache
key: node-${{ hashFiles('package-lock.json') }}
restore-keys: |
node-
- name: Install markdown2confluence
run: npm install -g @shogobg/[email protected]
- name: Install npm dependencies (markdown2confluence)
run: npm ci
shell: bash

- name: Run sync_to_jira.py
Expand Down
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"@shogobg/markdown2confluence": "^0.1.6"
}
}
3 changes: 2 additions & 1 deletion sync_jira_actions/sync_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def _markdown2wiki(markdown):
mdf.write('\n')

try:
subprocess.check_call(['markdown2confluence', md_path, conf_path]) # noqa: S603, S607
# subprocess.check_call(['markdown2confluence', md_path, conf_path]) # noqa: S603, S607
subprocess.check_call(['npx', 'markdown2confluence', md_path, conf_path]) # noqa: S603, S607
with open(conf_path, 'r', encoding='utf-8') as file:
result = file.read()
if len(result) > 16384: # limit any single body of text to 16KB (JIRA API limits total text to 32KB)
Expand Down

0 comments on commit 97968da

Please sign in to comment.