philips-software / post-to-medium-action

GitHub Action that allows you to create a new Medium post with Markdown or HTML.
MIT License
13 stars 2 forks source link

Could not find publication, did you enter the correct name or id? #16

Closed jerCarre closed 2 years ago

jerCarre commented 2 years ago

Hello,

I try tu use this github action but I have this error :

Unhandled exception. System.Exception: Could not find publication, did you enter the correct name or id?
   at PostMediumGitHubAction.Services.MediumService.SubmitNewContentAsync() in /Action/Services/MediumService.cs:line 28
   at PostMediumGitHubAction.Program.Main(String[] args) in /Action/Program.cs:line 19
   at PostMediumGitHubAction.Program.<Main>(String[] args)

My workflow :

name: publish-to-medium
on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Read the post
        id: post
        run: echo "::set-output name=data::$(cat ./README.md)"
      - name: Create Medium Post
        uses: philips-software/post-to-medium-action@v0.3.4
        with:
          integration_token: "${{ secrets.MEDIUM_ACCESS_TOKEN }}"
          file: "./README.md"
          content_format: "markdown"
          publication_id: "PublicationName"
          publication_name: "publication"
          tags: "markdown,vega,vegalite,docsify,github"
          title: "Comment afficher le cours d'une crypto sur sa page github ?"

There's non article in medium.

Could you help me ?

Brend-Smits commented 2 years ago

Hey @jerCarre, Sorry for the delayed response. I missed this due to the holidays! The publication Name or Id has now been made optional so you can remove those. If you do not want to publish your article under a publication, you can leave them both out and it will automatically post it under the account of which you are authenticating.

Your new workflow would be as follows:

name: publish-to-medium
on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Read the post
        id: post
        run: echo "::set-output name=data::$(cat ./README.md)"
      - name: Create Medium Post
        uses: philips-software/post-to-medium-action@v0.4.0
        with:
          integration_token: "${{ secrets.MEDIUM_ACCESS_TOKEN }}"
          file: "./README.md"
          content_format: "markdown"
          tags: "markdown,vega,vegalite,docsify,github"
          title: "Comment afficher le cours d'une crypto sur sa page github ?"

I released a new version https://github.com/philips-software/post-to-medium-action/releases/tag/v0.4.0 to make this possible.

Thank you for opening a new issue, please let me know if you require additional help.

jerCarre commented 2 years ago

Thank you for this new release but I have the same error :

Run philips-software/post-to-medium-action@v0.4.0
  with:
    integration_token: ***
    file: ./README.md
    content_format: markdown
    tags: markdown,vega,vegalite,docsify,github
    title: Comment afficher le cours d'une crypto sur sa page github ?
    publish_status: draft
    notify_followers: false
    license: all-rights-reserved
    parse_frontmatter: false
/usr/bin/docker run --name ghcriophilipssoftwareposttomediumactionv040_7d2f56 --label 6a6825 --workdir /github/workspace --rm -e INPUT_INTEGRATION_TOKEN -e INPUT_FILE -e INPUT_CONTENT_FORMAT -e INPUT_TAGS -e INPUT_TITLE -e INPUT_CONTENT -e INPUT_PUBLISH_STATUS -e INPUT_NOTIFY_FOLLOWERS -e INPUT_LICENSE -e INPUT_PUBLICATION_NAME -e INPUT_PUBLICATION_ID -e INPUT_CANONICAL_URL -e INPUT_PARSE_FRONTMATTER -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/docsify_vega/docsify_vega":"/github/workspace" ghcr.io/philips-software/post-to-medium-action:v0.4.0  "--integration-token" "***" "--title" "Comment afficher le cours d'une crypto sur sa page github ?" "--tags" "markdown,vega,vegalite,docsify,github" "--canonical-url" "" "--publish-status" "draft" "--license" "all-rights-reserved" "--publication-id" "" "--publication-name" "" "--notify-followers" "false" "--content-format" "markdown" "--content" "" "--file" "./README.md" "--parse-frontmatter" "false"
Unhandled exception. System.Exception: Could not find publication, did you enter the correct name or id?
   at PostMediumGitHubAction.Services.MediumService.SubmitNewContentAsync() in /Action/Services/MediumService.cs:line 34
   at PostMediumGitHubAction.Program.Main(String[] args) in /Action/Program.cs:line 19
   at PostMediumGitHubAction.Program.<Main>(String[] args)
Brend-Smits commented 2 years ago

Thanks, I'm able to reproduce now: https://github.com/philips-software/post-to-medium-action/runs/4704659246?check_suite_focus=true#step:4:14 I will let you know when it's fixed!

Brend-Smits commented 2 years ago

I released a new version that should fix this. Can you please verify @jerCarre? See: https://github.com/philips-software/post-to-medium-action/releases/tag/v0.4.1 Make sure to change your workflow version from @v0.4.0 to @v0.4.1

Brend-Smits commented 2 years ago

I will close this issue as I believe this has been resolved (checked your repository and it seems to be working now 😉) If not, please let me know.

jerCarre commented 2 years ago

It ok now.

Thx