Skip to content

[Question]: Tree Mode: Action tries to create new confluence file when one already exists  #67

@joshua-janicas

Description

@joshua-janicas

Hi there!

Sorry that this is labeled as a bug; I think it's more of a user error on my part but there wasn't any other better option to choose from.

I have been reading documentation on the tree mode format:

https://github.com/Telefonica/confluence-tools/tree/main/components/confluence-sync#tree-mode-1

However when I try to run tree mode with the following configuration:

      - name: Sync Data Dictionary to Confluence
        uses: Telefonica/markdown-confluence-sync-action@fb25441e9a643880dd5ce9494e0e848313bc5a8d
        with:
          mode: tree
          docs-dir: './docs/data-dictionary'
          files-pattern: '*.md'
          confluence-url: 'https://ABC.atlassian.net/wiki'
          confluence-root-page-id: '2573500491'
          confluence-space-key: 'ABC'
          # https://github.com/MrRefactoring/confluence.js?tab=readme-ov-file#authentication
          confluence-authentication: |
            {
              "basic": {
                "email": "${{ vars.ATLASSIAN_CLOUD_API_USERNAME }}",
                "apiToken": "${{ secrets.ATLASSIAN_CLOUD_API_APIKEY }}"
              }
            }
          rehype: |
            {
              "codeBlocks": true
            }

The action runs into an error if the confluence file already exists:

Image
Error creating page with title [staging][content] stg_core_db__product_price_fee: Unexpected Error: com.atlassian.confluence.api.service.exceptions.api.BadRequestException: A page with this title already exists: A page already exists with the same TITLE in this space

And the markdown file looks like this

---
title: stg_core_db__product_price_fee
sync_to_confluence: true
---

# stg_core_db__product_price_fee

(documentation...)

I would think that if it found the file, it should be updating/overwriting instead of doing a complete creation. Am I missing something extra that I should be configuring?

Thank you.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions