contentful-userland / contentful-action

MIT License
14 stars 16 forks source link

Issue with using this gitHubAction #5

Open khirod-dev opened 3 years ago

khirod-dev commented 3 years ago

I am using this action for migrating content as below in in my githib_action.yamlfile

- name: Contentful Migration
        id: migrate
        uses: contentful-userland/contentful-action@v1
        with:
          space_id: XXXXX
          management_api_key: XXXXX
          migrations_dir: XXXXX
        env:
          LOG_LEVEL: verbose

following error comes up

Warning: Unexpected input(s) 'space_id', 'management_api_key', 'migrations_dir', valid inputs are ['']
Run contentful-userland/contentful-action@v1
  with:
    space_id: XXXX
    management_api_key: XXXXX
    migrations_dir: XXXXX
  env:
    LOG_LEVEL: verbose
Error: Expected parameter accessToken
togmund commented 3 years ago

I think this line is your problem:

uses: contentful-userland/contentful-action@v1

v1, if you look at the releases, is pointing at an older variant of this action which did not include those "with" inputs.

You'll have more luck if you use:

uses: contentful-userland/contentful-action@main
khirod-dev commented 3 years ago

Hi @togmund , I tried your input .but see a different error coming up .

💩 TypeError: Cannot read property 'replace' of null
Error: Cannot read property 'replace' of null
pixelass commented 3 years ago

@togmund There is actually just one version. There are older actions that use a different name.

see: https://github.com/marketplace/actions/contentful-action

pixelass commented 3 years ago

@khirodAsurion Thank you for reporting. I will test your setup somewhen next week and report back in case I find the issue.

pixelass commented 3 years ago

@khirodAsurion If you are available on the contentful slack please ping me "Gregor Adams", maybe we can debug this together.

aghuddleston commented 3 years ago

Needs to be env and not with and uppercase, like so:

      - name: Contentful Action
        id: migration
        uses: contentful-userland/contentful-action@v1
        env:
          MIGRATIONS_DIR: 'migrations'
          SPACE_ID: ${{ secrets.SPACE_ID }}
          MANAGEMENT_API_KEY: ${{ secrets.MANAGEMENT_API_KEY }}
          LOG_LEVEL: verbose
khirod-dev commented 3 years ago

Hello @aghuddleston , Thanks for that information . seems it is working now from a GITHUB Action perspective . I Can see logs as all committed. But when I see in contentful for the new Filed That I added part of script when i see in contentful has not been added :(


Environment: GH-contentful-cicd

Update Content Type homePlus

  Create field newCat
    - type: "Symbol"
    - name: "newCat"

Publish Content Type homePlus
25l[19:43:47] Update Content Type homePlus [started]
[19:43:47] Making requests [started]
[19:43:47] Making requests (1/2) [title changed]
[19:43:47] → PUT /content_types/homePlus at V10
[19:43:47] Making requests (2/2) [title changed]
[19:43:47] → PUT /content_types/homePlus/published at V11
[19:43:47] Making requests (2/2) [completed]
[19:43:47] Update Content Type homePlus [completed]
25h🎉  Migration successful
2 succeeded
Updated version entry to 2
Checking if we need to update master alias
Running on feature branch
No alias changes required
All done!

. Any reason why ?

khirod-dev commented 3 years ago

My bad, I was looking at master than the branch . i can see the change in branch of contentful. thanks .

khirod-dev commented 3 years ago

Hello @aghuddleston , Will the branch that got created for the migration will auto merged to master ? and clean up of the branch will happen automatically on PR merge ? or how is that action taken care ?

aghuddleston commented 3 years ago

@khirodAsurion I'm just starting to use this action, and learning how it works as I go, and therefore, don't know the answers to your questions.