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

[Blocked] Warnings about unexpected inputs #26

Open
dgholz opened this issue May 25, 2020 · 26 comments
Open

[Blocked] Warnings about unexpected inputs #26

dgholz opened this issue May 25, 2020 · 26 comments
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects

Comments

@dgholz
Copy link

dgholz commented May 25, 2020

Hello, I have a step in my workflow like:

      - name: Get count of commits ahead of merge base
        id: github_compare
        uses: octokit/request-action@v2.x
        with:
          route: GET /repos/:repository/compare/:base...:head
          repository: ${{ github.repository }}
          base: ${{ github.base_ref }}
          head: ${{ github.ref }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

When the workflow runs, I see Annotations about unexpected inputs, and in the workflow output, I see:

##[warning]Unexpected input 'repository', valid inputs are ['route', 'mediaType']
##[warning]Unexpected input 'base', valid inputs are ['route', 'mediaType']
##[warning]Unexpected input 'head', valid inputs are ['route', 'mediaType']
Run octokit/request-action@v2.x
  with:
    route: GET /repos/:repository/compare/:base...:head
    repository: dgholz/my_repo
    base: master
    head: refs/pull/1/merge
    mediaType: {}
  env:
    GITHUB_TOKEN: ***
GET /repos/:repository/compare/:base...:head
> repository: dgholz/my_repo
> base: master
> head: refs/pull/1/merge
> mediaType: [object Object]
< 200 451ms

How do I prevent these warnings from appearing?

@ghost ghost added this to Inbox in JS May 25, 2020
@dgholz dgholz changed the title Warnings about unexpected inputs for /repos/:repo/compare/:base...:head Warnings about unexpected inputs for /repos/:repository/compare/:base...:head May 25, 2020
@gr2m
Copy link
Contributor

gr2m commented May 26, 2020

Unfortunately there is no way to prevent these warnings, it looks like they are a recent change in the GitHub Actions runner. All inputs that are not defined in the action.yml file now trigger this warning, and there is no flag to suppress them at this point 😭

I'll reach out to support and ask about it, we can leave the issue open for the time being

@gr2m gr2m changed the title Warnings about unexpected inputs for /repos/:repository/compare/:base...:head [Blocked] Warnings about unexpected inputs May 26, 2020
@gr2m gr2m added the Type: Support Any questions, information, or general needs around the SDK or GitHub APIs label May 28, 2020
@ghost ghost moved this from Inbox to Support in JS May 28, 2020
@softprops
Copy link

👋 I've received a report from users of an action I maintain with similar warnings.

In my case I define an input as a pattern rather than a static name to support user defined named sets of files included in a diff . The current action.yml file descriptor lacks an ability to express input names as patterns. Since inputs are just a conventionally named env variable in thier implementation I can have users just declare INPUT_ env names instead. That feels less than ideal for an interface.

Is there any other way to suppress these on an per-action level? I understand why GitHub might have added these warnings. In my case, it makes a working action look broken.

@gr2m
Copy link
Contributor

gr2m commented Jun 6, 2020

make sure to contact support at support.github.com/contact to let them know about your use case. It will bump the priority. And the more use cases there are, the better. I have hope that a setting to suppress these warnings will be added, the sooner the better :)

@junghans
Copy link

@gr2m thanks! Any ETA?

@gr2m
Copy link
Contributor

gr2m commented Jun 17, 2020

Nothing that I heard. Did you check in with support? I think they are aware of the problem, but I'm not sure what the current state is, i have no insights myself.

@gr2m gr2m added the Status: Blocked Some technical or requirement is blocking the issue label Jun 17, 2020
@ghost ghost moved this from Support to Blocked (by GitHub APIs) in JS Jun 17, 2020
@bryanwweber
Copy link
Contributor

One issue is that the README in this repository suggests using the repository key, which raises this warning. Perhaps as an interim solution the README can be updated to note that this warning will be present but everything works as expected?

@gr2m
Copy link
Contributor

gr2m commented Jul 21, 2020

Very good idea! Would you like to send a PR?

gr2m pushed a commit that referenced this issue Jul 22, 2020
Add some text explaining the cause of the warnings that are shown when using this action. The warnings are normal and can be ignored as long as a 200 status code is returned. Related to #26.
@tillkruss
Copy link

@gr2m: Where is the actions.yml? Is it part of this repo, or the one that uses octokit/request-action?

@gr2m
Copy link
Contributor

gr2m commented Mar 22, 2021

The one in this repository: https://github.com/octokit/request-action/blob/master/action.yml

@tillkruss
Copy link

@gr2m: Can I open a PR with two dozen common input names to avoid the most frequent warnings?

@gr2m
Copy link
Contributor

gr2m commented Mar 22, 2021

sure, thank you!

I was expecting GitHub to fix that swiftly but looks like it got lost in the backlog.

@gr2m
Copy link
Contributor

gr2m commented Mar 22, 2021

also if you could reach out to https://support.github.com/contact as well that'd be helpful, it will prioritize the request to add some kind of flag to suppress warnings for undefined parameters

@gr2m
Copy link
Contributor

gr2m commented Apr 22, 2021

There is an open issue on the actions runner repository to address this problem:
actions/runner#514

The runner is open source and written in C#, I'm sure they'd accept a good PR. It's not something the actions team has currently on their roadmap.

@spol-vt
Copy link

spol-vt commented Sep 24, 2021

Any traction on above Warnings issue?

I had a jackpot moment when I came across this action as it would save me on wrapping octokit steps in JavaScript (@actions/github-script), however those pesky warning Annotations are unpresentable to developers/business in a professional setting making every workflow look broken :-/

@gr2m
Copy link
Contributor

gr2m commented Sep 24, 2021

Can you reach out to support to bump the priority for getting this fixed? It’s been so long since there has been any movement in this :(

@razbensimon
Copy link

+1

1 similar comment
@kakuzei
Copy link

kakuzei commented Oct 15, 2021

+1

@cardinalby
Copy link

As a workaround you can pass inputs as env variables as follows:

      - name: Get count of commits ahead of merge base
        id: github_compare
        uses: octokit/request-action@v2.x
        with:
          route: GET /repos/:repository/compare/:base...:head
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          INPUT_REPOSITORY: ${{ github.repository }}
          INPUT_BASE: ${{ github.base_ref }}
          INPUT_HEAD: ${{ github.ref }}

@KodaCHC
Copy link

KodaCHC commented Feb 16, 2022

@cardinalby thank you. Can you say me what is the solution for issues?

I use this:

      - name: Issues
        uses: octokit/request-action@v2.x
        id: myissues
        with:
          route: GET /search/issues
          q: 'repo:${{ env.myrepo }} milestone:"${{ env.mymilestone }}" label:"Bugfix","Label 1",Label 2"'
          per_page: 100
        env:
          GITHUB_TOKEN: ${{ .... }}

If I do the same first without env variabeln I get no more results

      - name: Issues
        uses: octokit/request-action@v2.x
        id: myissues
        with:
          route: GET /search/issues?q=repo:MYREPO
        env:
          GITHUB_TOKEN: ${{ .... }}

@cardinalby
Copy link

@KodaCHC It seems to be unrelated to this issue. The library may not allow query parameters in a route (but expects them in as separate params, as you showed in the first example). Back to the issue, try passing them as INPUT_Q and INPUT_PER_PAGE env variables if you want to avoid warnings.

@KodaCHC
Copy link

KodaCHC commented Feb 16, 2022

Danke Thanks for the answer. How do I specify q without listing it under with?

@cardinalby
Copy link

See my initial answer, you can pass INPUT_Q env variable in env: section. It will work as if you set q input

@KodaCHC
Copy link

KodaCHC commented Feb 17, 2022

Thank you. I misunderstood that. This works really well.

@sasankaweera123

This comment was marked as off-topic.

gwenn-magna added a commit to magna-labs/miqa-test-kickoff that referenced this issue Jun 27, 2023
* Pass inputs to octokit as env variables instead of under the "with" section, to avoid "Unexpected inputs" warning (see octokit/request-action#26)
* Change the set-output method to instead directly set output parameters to avoid warning "The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files" (see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/)
* Update the http-request-action and octokit/request-action to latest
gwenn-magna added a commit to magna-labs/miqa-test-kickoff-only that referenced this issue Jun 27, 2023
* Pass inputs to octokit as env variables instead of under the "with" section, to avoid "Unexpected inputs" warning (see octokit/request-action#26)
* Change the set-output method to instead directly set output parameters to avoid warning "The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files" (see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/)
* Update the http-request-action and octokit/request-action to latest
yumauri added a commit to yumauri/effector-storage that referenced this issue Jul 16, 2023
@adrianjost
Copy link

Shouldn't it be possible to have only a single variables input, that accepts an object with the custom keys? That one inut can be defined and wouldn't throw the warning.
Only issue is, that GitHub doesn't seem to support maps as input values directly, so the action would need to parse them, and in the config we would need to JSON stringify the object before passing it to the action.

https://stackoverflow.com/a/67058647

@gr2m
Copy link
Contributor

gr2m commented Feb 1, 2024

I'm not sure if we implemented it for the action, but the underlying Octokit supports data for that, so you might be able to use it, just make sure you pass it as string

  data: |
    owner: ...
    repo: ...
    # etc 

I think it's less elegant though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
No open projects
JS
  
Blocked
Development

No branches or pull requests