Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action fails with Unrecognized named-value: 'github'. #1

Closed
relsqui opened this issue Oct 31, 2023 · 10 comments
Closed

Action fails with Unrecognized named-value: 'github'. #1

relsqui opened this issue Oct 31, 2023 · 10 comments

Comments

@relsqui
Copy link

relsqui commented Oct 31, 2023

Here's how I called it:

    - id: get-members
      uses: GuillaumeFalourd/github-team-members@v1
      with:
        org_slug: <string redacted>
        team_slug: ${{ inputs.team-slug }}
        token: ${{ secrets.ORG_READ_TOKEN }}

and here's the complete error:

Error: GuillaumeFalourd/github-team-members/v1/action.yml (Line: 34, Col: 18): Unrecognized named-value: 'github'. Located at position 1 within expression: github.actor
Error: GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. GuillaumeFalourd/github-team-members/v1/action.yml (Line: 34, Col: 18): Unrecognized named-value: 'github'. Located at position 1 within expression: github.actor

Looks like someone else solved it like this?

Copy link

Thank you for opening this ISSUE. We'll give you a return ASAP 👍

@GuillaumeFalourd
Copy link
Owner

Hi @relsqui , thank you for opening this issue and even suggesting a solution! 🚀

I've updated the action.yaml file according to link you shared, could you try again using

    - id: get-members
      uses: GuillaumeFalourd/github-team-members@main
      with:
        org_slug: <string redacted>
        team_slug: ${{ inputs.team-slug }}
        token: ${{ secrets.ORG_READ_TOKEN }}

Before I update the release version to confirm it's working as expected?

@relsqui
Copy link
Author

relsqui commented Nov 2, 2023

Thanks Guillaume, that's quick! I'll leave myself a note to give it a try at work tomorrow.

@relsqui
Copy link
Author

relsqui commented Nov 2, 2023

afraid not, but there's a new error so it's progress 😉

Run echo "data=$(gh api --paginate -X GET /orgs/$ORG_SLUG/teams/$TEAM_SLUG/members\?role=$ROLE | jq 'reduce inputs as $i (.; . += $i)')" >> $GITHUB_OUTPUT
Error: Unable to process file command 'output' successfully.
Error: Invalid format '  {'

@GuillaumeFalourd
Copy link
Owner

afraid not, but there's a new error so it's progress 😉

Run echo "data=$(gh api --paginate -X GET /orgs/$ORG_SLUG/teams/$TEAM_SLUG/members\?role=$ROLE | jq 'reduce inputs as $i (.; . += $i)')" >> $GITHUB_OUTPUT
Error: Unable to process file command 'output' successfully.
Error: Invalid format '  {'

Thank you for the return!
Out of curiosity, which permission(s) has the TOKEN you used as input in the action?

@relsqui
Copy link
Author

relsqui commented Nov 3, 2023

org:read and nothing else. for reference, the same token works fine here:

jobs:
  check-membership:
    runs-on: ubuntu-latest
    steps:
    - id: test-membership
      run: gh api --paginate "/orgs/MyOrg/teams/my-team-slug/members" | jq -e 'any(.login == "${{ github.actor }}")'

@GuillaumeFalourd
Copy link
Owner

GuillaumeFalourd commented Nov 3, 2023

For what I tested here, it seems that this command is also working as expected:

gh api --paginate -X GET "/orgs/$ORG_SLUG/teams/$TEAM_SLUG/members?role=$ROLE" | jq 'reduce inputs as $i (.; . += $i)'

Could you try executing it to see the output?

@GuillaumeFalourd
Copy link
Owner

I've updated the whole action if you can try again, I've used your suggestion as well.

    - id: get-members
      uses: GuillaumeFalourd/github-team-members@main
      with:
        org_slug: <string redacted>
        team_slug: ${{ inputs.team-slug }}
        token: ${{ secrets.ORG_READ_TOKEN }}

@relsqui
Copy link
Author

relsqui commented Nov 3, 2023

Looks like that works, thanks!

@GuillaumeFalourd
Copy link
Owner

Nice! I've updated the v1 tag with the correct version. Thanks for the feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants