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

[DOCS]: Clarify how to set body inputs #294

Open
1 task done
miguel-vila opened this issue Feb 9, 2024 · 3 comments
Open
1 task done

[DOCS]: Clarify how to set body inputs #294

miguel-vila opened this issue Feb 9, 2024 · 3 comments
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs

Comments

@miguel-vila
Copy link

Describe the need

I had to look into the code in order to do pass input to a workflow dispatch invocation. And I'm not sure if I did it the way that's intended. The inputs section in the readme wasn't clear enough to me. Could we clarify that?

This is the invocation I ended up with:

- uses: octokit/request-action@v2.x
  if: contains(github.event.pull_request.labels.*.name, 'open-ar-pr')
  with:
    route: POST /repos/platform-common/api-registry/actions/workflows/bump-arlib-version.yml/dispatches
    mediaType: application/vnd.github.v3+json
    ref: main
  env:
    GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
    INPUT_INPUTS: |
      {
        "pr-number": "${{ github.event.pull_request.number }}",
        "version": "${{ steps.get-version.outputs.version }}"
      }

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@miguel-vila miguel-vila added Status: Triage This is being looked at and prioritized Type: Documentation Improvements or additions to documentation labels Feb 9, 2024
Copy link

github-actions bot commented Feb 9, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@gr2m
Copy link
Contributor

gr2m commented Feb 9, 2024

I'd do

  with:
    route: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
    owner: platform-common
    repo: repo
    workflow_id: bump-arlib-version.yml
    ref: main
    inputs: |
        pr-number: "${{ github.event.pull_request.number }}"
        version: "${{ steps.get-version.outputs.version }}"

You can see examples of how to pass object body parameters in the advanced README example. The | is significant in order for the value to be parsed as an object

@gr2m gr2m added Type: Support Any questions, information, or general needs around the SDK or GitHub APIs and removed Type: Documentation Improvements or additions to documentation Status: Triage This is being looked at and prioritized labels Feb 9, 2024
@miguel-vila
Copy link
Author

@gr2m thank you, I think I tried that, but the format wasn't the correct. I was probably trying a JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

2 participants