Skip to content

Error Mapping Token when using Github workflows reusable #159

Closed
@ghost

Description

Hi all, I'm trying to create a reusable workflow from GitHub actions using actions/add-to-project. The problem is that it returns an error when parsing secrets A mapping was not expected Unexpected type 'MappingToken' encountered while reading 'input value'. The 'StringToken' type was expected.
This is my code:

Reusable flow:

name: "Adiciona Issues em Projects GitHub"

on:
  workflow_call:
    inputs:
      project_url:
        description: "URL do projetcs github"
        required: true
        type: string
    secrets:
      token:
        description: "Personal token para leitura/escrita projects github"
        required: true

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@main
        with:
          project-url: {{ inputs.project_url }}
          github-token: ${{ secrets.token }}

Reusable actions call:

name: "Adiciona Issues em Projects GitHub"
  
on:
  issues:
    types:
      - opened

jobs:
  add-issue:
    uses: "EzzioMoreira/lab-actions/.github/workflows/add-projects.yaml@master"
    with:
      project_url: https://github.com/users/EzzioMoreira/projects/2
    secrets:
      token: ${{ secrets.API_TOKEN_GITHUB }}

I tried using another realize tag but always returned the error The 'StringToken' type was expected.
I think that my code is correct.
Has anyone else reported any problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions