kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Apache License 2.0
1.03k stars 155 forks source link

Adding a Github action for mark #46

Open bhayes-zd opened 3 years ago

bhayes-zd commented 3 years ago

Hey there 👋 Love this project, so thank you for all that you do. Saves a lot of headache.

I think it could be really powerful to add direct support to run mark as a Github action via docker action. I've gone ahead and drafted up what that would look like below. Let me know if you'd like me to open a pull request!

# action.yml
name: 'mark'
description: 'Tool for updating Atlassian Confluence pages from markdown.'
branding:
    icon: 'book-open'
    color: 'blue'
inputs:
    commands:
        user: 
            description: 'The confluence user account'
            required: true
            default: ${{ .Env.MARK_PASS }}
        pass:
            description: 'The confluence account password'
            required: true
            default: ${{ .Env.MARK_PASS }}
        url:
            description: 'The url of the confluence account'
            required: true
            default: ${{ .Env.MARK_URL }}
    options:
       description: 'The arguments to run'
       required: false
       default: '--debug'
runs:
    using: 'docker'
    image: 'action.Dockerfile'
    args:
        - -u "${{ inputs.commands.user }}" -p "${{inputs.commands.pass}}" -b "${{inputs.commands.url}}" ${{inputs.options}}
# action.Dockerfile

# Container image that runs your code
FROM kovetskiy/mark

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
# entrypoint.sh

#!/bin/sh -l

mark $1 $2
leggomuhgreggo commented 3 years ago

This would be awesome -- the confluence-related GH Actions currently on the marketplace a pretty rudimentary.

@kovetskiy would you be open to that PR?

Edit: Found this repo with the GH Action version of this. Thanks