octokit / request-action Goto Github PK
View Code? Open in Web Editor NEWA GitHub Action to send arbitrary requests to GitHub's REST API
Home Page: https://github.com/marketplace/actions/GitHub-API-Request
License: MIT License
A GitHub Action to send arbitrary requests to GitHub's REST API
Home Page: https://github.com/marketplace/actions/GitHub-API-Request
License: MIT License
Going to https://github.com/marketplace/actions/github-api-request and click 'use latest version' gives me a version that is lower than the GitHub release version and about one year older:
Can you align them? Thanks for this cool action π₯³
Hello - I am requesting an updated to some dependencies that got flagged for this repo so that we can take advantage of it where I work.
The following dependencies came up as having security vulnerabilities:
Would it be possible to have these upgraded by any chance?
Thank you for your time.
> I see some repositories using `npm run build`
I'd always run it with npm run build --if-present
, just like the others. This makes sure that we verify that the dependencies only used for building are tested as part of the CI
npm run validate:ts
npm run test:typescript
npm run test:ts
I'm tending towards test:tsc
to be as clear as possible. In other project I use test:tsd
for type-only tests using tsd
, and in future when I hope me move away from TS source code I could imagine @octokit to use that, too (Example)
But I'm open to anything, it's not set in stone. I do agree we should normalize it across the @octokit repositories though
Originally posted by @gr2m in octokit/.github#13 (comment)
I've tried many things suggested in the docs both here and through GitHub, answers to issues and this is what I've come up with. No matter what I try nothing works and I still get a 404, even when using curl
.
I've noticed that mediaType
isn't consistent and appears as if people add in whatever they feel like. I suspect that may be causing an issue, however if that was the case then why are none of the other answers working? I removed the variables and just hard coded since I know which branch my action will be running on.
I also want to point out that we are on GitHub Enterprise and this is a private repo. I am using an access token that has write privileges, NOT a personal access token.
steps:
- name: Branch protection OFF
uses: octokit/[email protected]
with:
route: PUT /repos/digital-ai/dot-components/branches/develop/protection
mediaType: |
- Accept: application/vnd.github.v3+json
required_status_checks: |
null
enforce_admins: |
null
required_conversation_resolution: |
null
required_pull_request_reviews: |
null
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
Warning: Unexpected input(s) 'required_status_checks', 'enforce_admins', 'required_conversation_resolution', 'required_pull_request_reviews', valid inputs are ['route', 'mediaType']
Run octokit/[email protected]
with:
route: PUT /repos/digital-ai/dot-components/branches/develop/protection
mediaType: {"Accept": application/vnd.github.v3+json}
required_status_checks: null
enforce_admins: null
required_conversation_resolution: null
required_pull_request_reviews: null
env:
GITHUB_TOKEN: ***
PUT /repos/digital-ai/dot-components/branches/develop/protection
> mediaType: [object Object]
> required_status_checks: null
> enforce_admins: null
> required_conversation_resolution: null
> required_pull_request_reviews: null
Error: Not Found
Hey,
I am trying to build CI/CD pipeline using GitHub Actions and I wanted to split CI and CD flows into separate files. To do this I need to communicate them somehow, and because GitHub does not allow to tell that one workflow is dependent on another I wanted to use workflow triggers with webhook events - to be more precise - deployment event.
So, in my CI flow, I've added a job that triggers staging deployment:
staging_deployment:
if: github.event_name == 'pull_request' && (startsWith(github.head_ref, 'release/') || startsWith(github.head_ref, 'hotfix/'))
needs: integration
runs-on: ubuntu-latest
steps:
- name: Trigger staging deployment
uses: octokit/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
route: POST /repos/:repository/deployments
repository: ${{ github.repository }}
required_contexts: "[]"
environment: "staging"
ref: ${{ github.head_ref }}
the job should start only for specific branches and also it is triggered after integration
job finishes. All of these works fine, however, the listener is not triggered, even though listener is set to on: deployment
. What is weird, when I perform regular cURL request, everything works fine. Any clue what might be an issue?
Hello there,
I've been trying to call the rest api of this to update the visibility of a repository:
https://docs.github.com/en/[email protected]/rest/reference/repos#update-a-repository
However, every I am not able to pass a body to the route.
- uses: octokit/[email protected]
id: set_private
with:
route: PATCH /repos/$ORG/$REPO
mediaType: application/vnd.github.v3+json
body: ${{ toJSON(env.REQUEST_BODY) }}
env:
GITHUB_TOKEN: ${{ secrets.SITE_ADMIN_PAT }}
ORG: ${{ fromJSON(steps.issue_body_parser.outputs.payload).Organisation }}
REPO: ${{ fromJSON(steps.issue_body_parser.outputs.payload).Repository }}
REQUEST_BODY: |
'{ "visibility": "private" }'
--> Error: Cannot read property 'map' of undefined
Could you please support me with this? How can I pass over parameters in the body to a REST endpoint?
Best regards
Per Ahrens
I'm trying to convert readme.md to readme.html using POST /markdown
endpoint but could not figure out how to pass multi-line text parameter to the endpoint. The last line in the snippet below seems to be problematic, as it seems like lines that start with #
(markdown headings) are being skipped:
- name: Read README.md
id: read_readme
run: |
README=$(cat README.md)
README="${README//'%'/'%25'}"
README="${README//$'\n'/'%0A'}"
README="${README//$'\r'/'%0D'}"
echo ::set-output name=readme::$README
echo $README
- name: Print README.md
run: |
echo "${{ steps.read_readme.outputs.readme }}"
- name: Compile README.md
id: compile_readme
uses: octokit/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
route: POST /markdown
text: |+
${{ steps.read_readme.outputs.readme }}
Any suggestions on how to "fix" that behavior?
Is there a way to make request-action
to read parameters directly from the file bypassing all the escape/unescape string hassle?
On the home page https://github.com/octokit/request-action with the sample code you have, there is a typo in the part - run: "echo latest release: ${{ steps.get_latest_release.outputs.data }}"
It should actually be - run: echo "latest release: ${{ steps.get_latest_release.outputs.data }}"
The double quotes has been misplaced. Being the first day in github runners, took around 4 hours to figure out. So hope it is corrected.
I get this error:
Error: .github/workflows/android-ci.yml (Line: 37, Col: 24):
Error: The template is not valid. .github/workflows/android-ci.yml (Line: 37, Col: 24): Error reading JToken from JsonReader. Path '', line 0, position 0.
I think this is because I didn't add GITHUB_TOKEN. Where can I get this token?
v2.x
No response
Hey, just wondering how JSON is supposed to be sent?
Tried a few things but getting different errors back.
This is the API request I'm trying https://docs.github.com/en/rest/reference/issues#create-a-label
steps:
- uses: octokit/[email protected]
with:
route: POST /repos/${{ github.repository }}/labels
body: "'\\'{\"name\":\"React ${{ github.event.ref }}\"}\\''"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Error: end of the stream or a document separator is expected (1:4)
1 | '\'{"name":"React aarontwf-patch-2"}\''
--------^
body: "''{\"name\":\"React ${{ github.event.ref }}\"}''"
Error: end of the stream or a document separator is expected (1:3)
1 | ''{"name":"React aarontwf-patch-1"}''
-------^
body: "'{\"name\":\"React ${{ github.event.ref }}\"}'"
Error: Invalid request.
"name" wasn't supplied.
body: '{"name":"React ${{ github.event.ref }}"}'
Error: Invalid request.
"name" wasn't supplied.
The current handleError examle has these steps:
jobs:
handleError:
runs-on: ubuntu-latest
steps:
- uses: octokit/[email protected]
id: get_release
with:
route: GET /repos/{owner}/{repo}/releases/v0.9.9
owner: octokit
repo: request-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: "echo Release found: ${{ steps.get_release.outputs.data }}"
- run: "echo Release could not be found. Request failed with status ${{ steps.get_release.outputs.status }}"
if: ${{ failure() }}
The issue with that is that the first step will cause the workflow to end with failure if the release does not exist, so the second and third step will never be run to handle the error.
octokit/[email protected]
No response
No response
In https://github.com/opencollective/opencollective-frontend/blob/1eab647efdf0d953c1675d076273b177d4a38180/.github/workflows/e2e.yml#L90, we use request-action
to fetch the matching branch on remote repository (GET /repos/{owner}/{repo}/git/{ref}
).
This used to generate a valid URL like https://api.github.com/repos/opencollective/opencollective-frontend/git/refs/heads/debt/remove-guest-tokens, but since a few days we're getting an encoded version of the parameter instead, which results in the branch appearing as missing: https://api.github.com/repos/opencollective/opencollective-frontend/git/refs%2Fheads%2Fdebt%2Fremove-guest-tokens.
Maybe that's similar to #71?
Is there a way to tell request-action
to not URL encode a parameter?
Full debug log:
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Check matching branch'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Check matching branch
##[debug]Loading inputs
##[debug]Evaluating: github.ref
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'ref'
##[debug]=> 'refs/heads/debt/remove-guest-tokens'
##[debug]Result: 'refs/heads/debt/remove-guest-tokens'
Warning: Unexpected input(s) 'owner', 'repo', 'ref', valid inputs are ['route', 'mediaType']
##[debug]Loading env
Run octokit/[email protected]
GET /repos/:owner/:repo/git/:ref
> owner: opencollective
> repo: opencollective-frontend
> ref: refs/heads/debt/remove-guest-tokens
> mediaType: [object Object]
##[debug]route: 'GET /repos/:owner/:repo/git/:ref'
##[debug]parameters: {
##[debug] owner: 'opencollective',
##[debug] repo: 'opencollective-frontend',
##[debug] ref: 'refs/heads/debt/remove-guest-tokens',
##[debug] mediaType: {}
##[debug]}
##[debug]parsed request options: {
##[debug] method: 'GET',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v3+json',
##[debug] 'user-agent': 'octokit-action.js/3.2.0 octokit-core.js/3.2.4 Node.js/12.13.1 (linux; x64)'
##[debug] },
##[debug] request: { hook: [Function: bound bound register] },
##[debug] data: undefined,
##[debug] url: 'api.github.com/repos/opencollective/opencollective-frontend/git/refs%2Fheads%2Fdebt%2Fremove-guest-tokens'
##[debug]}
##[debug]RequestError [HttpError]: Not Found
##[debug] at /home/runner/work/_actions/octokit/request-action/v2.x/dist/index.js:6214:23
##[debug] at processTicksAndRejections (internal/process/task_queues.js:93:5)
##[debug] at async main (/home/runner/work/_actions/octokit/request-action/v2.x/dist/index.js:404:39) {
##[debug] name: 'HttpError',
##[debug] status: 404,
##[debug] headers: {
##[debug] 'access-control-allow-origin': '*',
##[debug] 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
##[debug] connection: 'close',
##[debug] 'content-encoding': 'gzip',
##[debug] 'content-security-policy': "default-src 'none'",
##[debug] 'content-type': 'application/json; charset=utf-8',
##[debug] date: 'Thu, 28 Jan 2021 10:33:08 GMT',
##[debug] 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
##[debug] server: 'GitHub.com',
##[debug] status: '404 Not Found',
##[debug] 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
##[debug] 'transfer-encoding': 'chunked',
##[debug] vary: 'Accept-Encoding, Accept, X-Requested-With',
##[debug] 'x-content-type-options': 'nosniff',
##[debug] 'x-frame-options': 'deny',
##[debug] 'x-github-media-type': 'github.v3; format=json',
##[debug] 'x-github-request-id': '07C0:4133:C9115:292009:601292E4',
##[debug] 'x-ratelimit-limit': '1000',
##[debug] 'x-ratelimit-remaining': '939',
##[debug] 'x-ratelimit-reset': '1611832435',
##[debug] 'x-ratelimit-used': '61',
##[debug] 'x-xss-protection': '1; mode=block'
##[debug] },
##[debug] request: {
##[debug] method: 'GET',
##[debug] url: 'api.github.com/repos/opencollective/opencollective-frontend/git/refs%2Fheads%2Fdebt%2Fremove-guest-tokens',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v3+json',
##[debug] 'user-agent': 'octokit-action.js/3.2.0 octokit-core.js/3.2.4 Node.js/12.13.1 (linux; x64)',
##[debug] authorization: 'token [REDACTED]'
##[debug] },
##[debug] request: { hook: [Function: bound bound register] }
##[debug] },
##[debug] documentation_url: 'docs.github.com/rest'
##[debug]}
Error: Not Found
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Check matching branch
Hi. I have the following workflow step:
createRepoUsingTemplate:
runs-on: ubuntu-latest
steps:
- uses: octokit/[email protected]
id: create_repo_using_template
with:
route: POST /repos/TEMPLATE_OWNER/TEMPLATE_REPO/generate
owner: OWNER
name: NAME
private: true
accept: 'application/vnd.github.baptiste-preview+json'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Even though I provided the Accept header as required by the preview notice, the request fails with HTTP code 415
and I'm getting the following error:
Error: If you would like to help us test the Repository Templates API during its preview period, you must specify a custom media type in the 'Accept' header. Please see the docs for full details.
When I manually call the HTTP request, everything works as expected:
POST https://api.github.com/repos/TwoDigits/url-shortener/generate
Accept: application/vnd.github.baptiste-preview+json
Authorization: Basic .....
Content-Type: application/json
{
"owner": "OWNER",
"name": "NAME"
}
Response code: 201 (Created); Time: 1861ms; Content length: 6500 bytes
I'm trying to write a GitHub action that temporarily disabled merging by requiring admin access. so I wrote an action like this:
name: Disable merging
on:
# Manual trigger
workflow_dispatch:
inputs:
branch:
description: What branch to protect
default: main
required: true
jobs:
disable-merging:
name: Disable Merging
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Removed the admin protection
uses: octokit/[email protected]
id: remove_admin_protection
with:
route: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
owner: TheOddler
repo: github-actions-tests
branch: ${{ github.event.inputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# some more jobs to wait and then reenable again
However, when I run this I get the error "Resource not accessible by integration". From what I could find online it might be a permission problem, but I set the github token to have read/write access:
I enabled debug info, but it didn't tell me much new, other than that I'm getting a 403 error from github:
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Removed the admin protection'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Removed the admin protection
##[debug]Loading inputs
##[debug]Evaluating: github.event.inputs.branch
##[debug]Evaluating Index:
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating github:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'event'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'inputs'
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'branch'
##[debug]=> 'main'
##[debug]Result: 'main'
Warning: Unexpected input(s) 'owner', 'repo', 'branch', valid inputs are ['route', 'mediaType']
##[debug]Loading env
Run octokit/[email protected]
POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
> owner: TheOddler
> repo: github-actions-tests
> branch: main
> mediaType: [object Object]
##[debug]route: 'POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins'
##[debug]parameters: {
##[debug] owner: 'TheOddler',
##[debug] repo: 'github-actions-tests',
##[debug] branch: 'main',
##[debug] mediaType: {}
##[debug]}
##[debug]parsed request options: {
##[debug] method: 'POST',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v3+json',
##[debug] 'user-agent': 'octokit-action.js/3.7.1 octokit-core.js/3.4.0 Node.js/12.22.7 (linux; x64)',
##[debug] 'content-length': 0
##[debug] },
##[debug] request: { hook: [Function: bound bound register] },
##[debug] data: undefined,
##[debug] url: 'https://api.github.com/repos/TheOddler/github-actions-tests/branches/main/protection/enforce_admins'
##[debug]}
< 403 222ms
::set-output name=status::403
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
##[debug]steps.remove_admin_protection.outputs.status='403'
##[debug]RequestError [HttpError]: Resource not accessible by integration
##[debug] at /home/runner/work/_actions/octokit/request-action/v2.1.0/dist/index.js:6251:23
##[debug] at processTicksAndRejections (internal/process/task_queues.js:97:5)
##[debug] at async main (/home/runner/work/_actions/octokit/request-action/v2.1.0/dist/index.js:404:39) {
##[debug] status: 403,
##[debug] headers: {
##[debug] 'access-control-allow-origin': '*',
##[debug] 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
##[debug] connection: 'close',
##[debug] 'content-encoding': 'gzip',
##[debug] 'content-security-policy': "default-src 'none'",
##[debug] 'content-type': 'application/json; charset=utf-8',
##[debug] date: 'Thu, 13 Apr 2023 16:58:46 GMT',
##[debug] 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
##[debug] server: 'GitHub.com',
##[debug] 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
##[debug] 'transfer-encoding': 'chunked',
##[debug] vary: 'Accept-Encoding, Accept, X-Requested-With',
##[debug] 'x-content-type-options': 'nosniff',
##[debug] 'x-frame-options': 'deny',
##[debug] 'x-github-api-version-selected': '2022-11-28',
##[debug] 'x-github-media-type': 'github.v3; format=json',
##[debug] 'x-github-request-id': '0481:791A:1A5B4EA:35D023B:643834C6',
##[debug] 'x-ratelimit-limit': '1000',
##[debug] 'x-ratelimit-remaining': '996',
##[debug] 'x-ratelimit-reset': '1681407830',
##[debug] 'x-ratelimit-resource': 'core',
##[debug] 'x-ratelimit-used': '4',
##[debug] 'x-xss-protection': '0'
##[debug] },
##[debug] request: {
##[debug] method: 'POST',
##[debug] url: 'https://api.github.com/repos/TheOddler/github-actions-tests/branches/main/protection/enforce_admins',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v3+json',
##[debug] 'user-agent': 'octokit-action.js/3.7.1 octokit-core.js/3.4.0 Node.js/12.22.7 (linux; x64)',
##[debug] 'content-length': 0,
##[debug] authorization: 'token [REDACTED]'
##[debug] },
##[debug] request: { hook: [Function: bound bound register] }
##[debug] },
##[debug] documentation_url: 'https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection'
##[debug]}
Error: Resource not accessible by integration
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Removed the admin protection
What am I missing?
I'm trying to get tags associated with container images by hitting the below endpoint:
route: GET /orgs/{org}/packages/container/{container}/versions
When using this action the returned data appears to be truncated to 30 items!?!
Using the gh
cli correctly returns all image ids/tags:
data=$(gh api -X GET --paginate "/orgs/${org}/packages/container/${container}/versions")
echo $data | jq 'map({(.id|tostring): .metadata.container.tags}) | add'
Am I missing something obvious (e.g. a paginate argument) or is this a bug?
name: Get Image Tags
description: 'Returns the tags associated with a container image.'
inputs:
repo:
required: true
type: string
container:
required: true
type: string
ghcr_token:
required: true
outputs:
images:
description: "A mapping of image ids to image tags."
value: ${{ steps.set_output.outputs.images }}
runs:
using: "composite"
steps:
- id: parse_repo
shell: bash
run: |
set -euox pipefail
IFS='/' read owner repo <<< ${{ inputs.repo }}
echo "::set-output name=org::${owner}"
echo "::set-output name=container::${repo,,}/${{ inputs.container }}"
- id: get_images
# https://github.com/octokit/request-action
uses: octokit/[email protected]
env:
GITHUB_TOKEN: ${{ inputs.ghcr_token }}
with:
org: ${{ steps.parse_repo.outputs.org }}
container: ${{ steps.parse_repo.outputs.container }}
route: GET /orgs/{org}/packages/container/{container}/versions
- id: set_output
shell: bash
run: |
set -euox pipefail
images=$(echo -e ${{ toJSON(steps.get_images.outputs.data) }} | jq -c 'map({(.id|tostring): .metadata.container.tags}) | add')
echo "::set-output name=images::${images}"
Consider the following Actions config:
- name: Generate Actions Runner token
uses: octokit/[email protected]
id: generate-actions-runner-token
with:
route: POST /repos/{owner}/{repo}/actions/runners/registration-token
owner: ${{ env.ACTIONS_RUNNER_ORG }}
repo: ${{ env.ACTIONS_RUNNER_REPO }}
env:
GITHUB_TOKEN: ${{ secrets.GH_API_PAT }}
- name: Set and mask Actions Runner token for next steps
run: |
# We need to mask the token first before setting it to an env variable
echo "::add-mask::${{ fromJson(steps.generate-actions-runner-token.outputs.data).token }}"
ACTIONS_RUNNER_TOKEN=${{ fromJson(steps.generate-actions-runner-token.outputs.data).token }}
echo ACTIONS_RUNNER_TOKEN=$ACTIONS_RUNNER_TOKEN >> $GITHUB_ENV
This actually exposes the token to the CI logs, as also reported in this issue: actions/runner#475
You might want to add a warning about this to the README of this action or find another solution to hide this sensitive data. Thanks!
octokit/[email protected]
See above
Hello, I have a step in my workflow like:
- name: Get count of commits ahead of merge base
id: github_compare
uses: octokit/[email protected]
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/[email protected]
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?
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: author, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: name, Invalid configuration option: packageRules[0].@actions/core, Invalid configuration option: packageRules[0].@octokit/action, Invalid configuration option: packageRules[0].js-yaml, Invalid configuration option: packageRules[1].@semantic-release/git, Invalid configuration option: packageRules[1].@zeit/ncc, Invalid configuration option: packageRules[1].semantic-release, Invalid configuration option: private, Invalid configuration option: release, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: version
I am trying to use the action behind the proxy
- # Action that gets the user information
uses: octokit/[email protected]
id: get_user_info
with:
route: GET /users/${{ github.event.issue.user.login }}
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
http_proxy: "xxxxx"
https_proxy: "xxxxx"
This is giving the timeout error
Run octokit/[email protected]
/usr/bin/docker exec fe3c2a23934f2469271a5bfd5a1a780c5380eebc5f51836793013bc2c3d315c3 sh -c "cat /etc/*release | grep ^ID"
GET /users/vppawar
> mediaType: [object Object]
Error: request to https://api.github.com/users/vppawar failed, reason: connect ETIMEDOUT 192.30.255.117:443
The endpoint https://api.github.com/users/vppawar works fine when called using curl after specifying the proxy
We have a workflow that requests the list of files modified by a PR. Here's the code:
name: kube-score
on:
# pull_request workflows run in the context of the fork, when applicable, and
# thus does not have permission to comment on the PR. To support this, this
# workflow only publishes an artifact and the comment will be posted by the
# pr-comment workflow.
# https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks
pull_request:
paths:
- "**-version.txt"
jobs:
kube-score:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: octokit/[email protected]
id: list_files
with:
route: GET /repos/:repository/pulls/:number/files
repository: ${{ github.repository }}
number: ${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This stopped working when v2.0.25 was released. The error is not found
:
2021-01-25T21:49:32.3761923Z Download action repository 'octokit/[email protected]'
2021-01-25T21:49:35.9635012Z ##[warning]Unexpected input(s) 'repository', 'number', valid inputs are ['route', 'mediaType']
2021-01-25T21:49:35.9691635Z ##[group]Run octokit/[email protected]
2021-01-25T21:49:35.9692287Z with:
2021-01-25T21:49:35.9692842Z route: GET /repos/:repository/pulls/:number/files
2021-01-25T21:49:35.9693621Z repository: <redacted>
2021-01-25T21:49:35.9694284Z number: 8631
2021-01-25T21:49:35.9694703Z mediaType: {}
2021-01-25T21:49:35.9695128Z env:
2021-01-25T21:49:35.9696104Z GITHUB_TOKEN: ***
2021-01-25T21:49:35.9696545Z ##[endgroup]
2021-01-25T21:49:36.3260397Z GET /repos/:repository/pulls/:number/files
2021-01-25T21:49:36.3261858Z > repository: <redacted>
2021-01-25T21:49:36.3262527Z > number: 8631
2021-01-25T21:49:36.3264255Z > mediaType: [object Object]
2021-01-25T21:49:36.4425840Z ##[error]Not Found
I looked at the diff and it's not obvious why it broke. I switched to - uses: octokit/[email protected]
and it started working again.
For consistency with the rest of the projects of the ecosystem
The README shows sample codes with {}
as an argument, but it does not work. The samples confuse users. I guess it's better to replace the syntax with :
.
For example,
# This does not work
- uses: octokit/[email protected]
id: get_latest_release
with:
route: GET /repos/{owner}/{repo}/releases/latest
owner: octokit
repo: request-action
# This works
- uses: octokit/[email protected]
id: get_latest_release
with:
route: GET /repos/:owner/:repo/releases/latest
owner: octokit
repo: request-action
Anyway, thanks for this great action!
Best regards,
could you please add into the documentation how it would be possible to upload a "latest" asset with a changing file name, but same ID, a little like in https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 ? i.e. the filename is package-1.0-qwers.zst, qwers beeing the git hash when it was built. the id should be "package" only.
Passing a multi-line body
sometimes produces an error depending on the contents of the string. Here are a few of the errors I've encountered:
body: |
*TODO*
produces
::error::unidentified alias "TODO*" (1:7)
1 | *TODO*
----------^
body: |
message
TODO:
produces
::error::end of the stream or a document separator is expected (2:5)
1 | Message
2 | TODO:
---------^
One workaround is to double-pipe the body as mentioned in #6 (comment).
body: |
|
...
βοΈ Important announcement: Greenkeeper will be saying goodbye π and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io
π¨ You need to enable Continuous Integration on Greenkeeper branches of this repository. π¨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didnβt receive a CI status on the greenkeeper/initial
branch, itβs possible that you donβt have CI set up yet.
We recommend using:
If you have already set up a CI for this repository, you might need to check how itβs configured. Make sure it is set to run on all new branches. If you donβt want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, youβll need to re-trigger Greenkeeperβs initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.
I have been using request-action normally at https://github.com/yf-dev/majsoul-plus-korean until yesterday.
However, about 11 hours ago, I found that the return value of API requests using request-action was changed to 404 without any reason.
I checked the request in request-action debug logs and tried to request it again through curl on the local computer as it is, but I was confused when I saw API returned 204 well.
Is there anything else I can check?
Debug log
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Run octokit/[email protected]'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run octokit/[email protected]
##[debug]Loading inputs
##[debug]Evaluating: format('GET /repos/:repository/collaborators/{0}', github.actor)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> 'GET /repos/:repository/collaborators/{0}'
##[debug]..Evaluating Index:
##[debug]....Evaluating github:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'actor'
##[debug]..=> 'rishubil'
##[debug]=> 'GET /repos/:repository/collaborators/rishubil'
##[debug]Result: 'GET /repos/:repository/collaborators/rishubil'
##[debug]Evaluating: github.repository
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'repository'
##[debug]=> 'yf-dev/majsoul-plus-korean'
##[debug]Result: 'yf-dev/majsoul-plus-korean'
Warning: Unexpected input(s) 'repository', valid inputs are ['route', 'mediaType']
##[debug]Loading env
Run octokit/[email protected]
with:
route: GET /repos/:repository/collaborators/rishubil
repository: yf-dev/majsoul-plus-korean
mediaType: {}
env:
GITHUB_TOKEN: ***
GET /repos/:repository/collaborators/rishubil
> repository: yf-dev/majsoul-plus-korean
> mediaType: [object Object]
##[debug]route: 'GET /repos/:repository/collaborators/rishubil'
##[debug]parameters: { repository: 'yf-dev/majsoul-plus-korean', mediaType: {} }
##[debug]parsed request options: {
##[debug] method: 'GET',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v3+json',
##[debug] 'user-agent': 'octokit-action.js/3.2.0 octokit-core.js/3.2.4 Node.js/12.13.1 (linux; x64)'
##[debug] },
##[debug] request: { hook: [Function: bound bound register] },
##[debug] data: undefined,
##[debug] url: 'https://api.github.com/repos/yf-dev/majsoul-plus-korean/collaborators/rishubil'
##[debug]}
##[debug]RequestError [HttpError]: Not Found
##[debug] at /home/runner/work/_actions/octokit/request-action/v2.x/dist/index.js:6214:23
##[debug] at processTicksAndRejections (internal/process/task_queues.js:93:5)
##[debug] at async main (/home/runner/work/_actions/octokit/request-action/v2.x/dist/index.js:404:39) {
##[debug] name: 'HttpError',
##[debug] status: 404,
##[debug] headers: {
##[debug] 'access-control-allow-origin': '*',
##[debug] 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
##[debug] connection: 'close',
##[debug] 'content-encoding': 'gzip',
##[debug] 'content-security-policy': "default-src 'none'",
##[debug] 'content-type': 'application/json; charset=utf-8',
##[debug] date: 'Tue, 23 Feb 2021 01:33:33 GMT',
##[debug] 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
##[debug] server: 'GitHub.com',
##[debug] 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
##[debug] 'transfer-encoding': 'chunked',
##[debug] vary: 'Accept-Encoding, Accept, X-Requested-With',
##[debug] 'x-content-type-options': 'nosniff',
##[debug] 'x-frame-options': 'deny',
##[debug] 'x-github-media-type': 'github.v3; format=json',
##[debug] 'x-github-request-id': '07C1:5299:3B87212:5F6507E:60345B6D',
##[debug] 'x-ratelimit-limit': '1000',
##[debug] 'x-ratelimit-remaining': '996',
##[debug] 'x-ratelimit-reset': '1614046910',
##[debug] 'x-ratelimit-used': '4',
##[debug] 'x-xss-protection': '1; mode=block'
##[debug] },
##[debug] request: {
##[debug] method: 'GET',
##[debug] url: 'https://api.github.com/repos/yf-dev/majsoul-plus-korean/collaborators/rishubil',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v3+json',
##[debug] 'user-agent': 'octokit-action.js/3.2.0 octokit-core.js/3.2.4 Node.js/12.13.1 (linux; x64)',
##[debug] authorization: 'token [REDACTED]'
##[debug] },
##[debug] request: { hook: [Function: bound bound register] }
##[debug] },
##[debug] documentation_url: 'https://docs.github.com/rest/reference/repos#check-if-a-user-is-a-repository-collaborator'
##[debug]}
Error: Not Found
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Run octokit/[email protected]
Curl log
$ curl -i --request GET --url https://api.github.com/repos/yf-dev/majsoul-plus-korean/collaborators/rishubil --header 'accept: application/vnd.github.v3+json' --header 'authorization: token [mytoken]' --header 'user-agent: octokit-action.js/3.2.0 octokit-core.js/3.2.4 Node.js/12.13.1 (linux; x64)'
HTTP/2 204
server: GitHub.com
date: Tue, 23 Feb 2021 01:39:18 GMT
x-oauth-scopes: repo, workflow
x-accepted-oauth-scopes:
x-github-media-type: github.v3; format=json
x-ratelimit-limit: 5000
x-ratelimit-remaining: 4968
x-ratelimit-reset: 1614046873
x-ratelimit-used: 32
access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'
vary: Accept-Encoding, Accept, X-Requested-With
x-github-request-id: FC7E:4120:24361D:6E749F:60345CC6
When attempting to use the action to perform a GET on the following API, the action fails:
...
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository }}/commits/${{ github.sha }}/pulls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Attempted it a few different ways - even with a manually specified SHA.
Octokit v2.x
Node 10.24 (RHEL 8)
/root/.cache/act/36476ce2c9b7795f/act/actions/[email protected]/dist/index.js:1905
static {
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
Error: β Failure - Main Get SHA pulls
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Error: exit status 1
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
π Job failed
Error: exit status 1
I'm not sure whether something changed on the side of this GitHub Action or in the GitHub API, but since IIRC last week we're suddenly seeing the first execution of our job to create a GitHub Deployment fail:
Run octokit/[email protected]
with:
route: POST /repos/:repository/deployments
repository: inrupt/solid-client-js
ref: 53ef88a177ee432c2942e5f50d6994c00641dc2d
environment: review
transient_environment: true
auto_merge: false
mediaType: {"previews": ["flash", "ant-man"]}
required_contexts: []
env:
CI: true
GITHUB_TOKEN: ***
POST /repos/:repository/deployments
> repository: inrupt/solid-client-js
> ref: 53ef88a177ee432c2942e5f50d6994c00641dc2d
> environment: review
> transient_environment: true
> auto_merge: false
> mediaType: [object Object]
> required_contexts:
Error: Resource not accessible by integration
These are not running in a fork, i.e. they're running in response to PRs from branches in the same repository as the one we want to create a Deployment for. Additionally, this used to work until recently, and after we select "Re-run all jobs" they do succeed. I think it might be just dependabot PRs that are failing in this way, but I haven't been able to verify that yet.
This is our job configuration:
jobs:
prepare-deployment:
runs-on: ubuntu-20.04
outputs:
tag-slug: ${{ steps.determine-npm-tag.outputs.tag-slug }}
deployment-id: ${{ fromJson(steps.create-deployment.outputs.data).id }}
steps:
- name: Create GitHub Deployment
id: create-deployment
uses: octokit/[email protected]
with:
route: POST /repos/:repository/deployments
repository: ${{ github.repository }}
ref: ${{ github.sha }}
environment: review
transient_environment: true
auto_merge: false
mediaType: '{"previews": ["flash", "ant-man"]}'
# The deployment runs in parallel with CI, so status checks will never have succeeded yet:
required_contexts: '[]'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
AFAIK we didn't make any changes, so any insights on what could be causing this would be much appreciated.
I use this call
- name: API Call
uses: octokit/[email protected]
id: get_issues_newfeatures
with:
route: GET /search/issues
q: 'repo:org/repo'
per_page: 100
I get this error: Unexpected input(s) 'q', 'per_page', valid inputs are ['route', 'mediaType']
The same if I want to use {org} and {repo}. is it possible to hide the warning?
Fount it. Sorry: #26
follow up to #80 (comment)
The setup would work similar to how https://github.com/octokit/plugin-paginate-rest.js updates src/generated/paginating-endpoints.ts.
update-endpoints
script that will take the OpenAPI specification from @octokit/openapi
, create/update a generated/rest-api-routes.js
file, which would be an array of all REST API routes that GitHub supportsgenerated/rest-api-routes.js
. If the route is unknown, log a warning if the response is a 404.No worries if that doesn't make sense @praneetloke, there is lots of inside knowledge behind how the automated updates work for the@octokit/*
packages based updates to GitHub's OpenAPI specifications
This issue contains a list of Renovate updates and their statuses.
These updates are awaiting their schedule. Click on a checkbox to ignore the schedule.
First of all, thanks for this helpful GitHub action!
I want to use this action to delete a specific label whenever a comment is created on an issue.
The label is: needs: reply
.
This is my workflow:
name: Remove needs-reply label
on:
issue_comment:
types:
- created
jobs:
needs-reply:
runs-on: ubuntu-latest
steps:
- name: Remove needs-reply label
uses: octokit/[email protected]
continue-on-error: true
with:
route: DELETE /repos/:repository/issues/:issue/labels/:label
repository: ${{ github.repository }}
issue: ${{ github.event.issue.number }}
label: 'needs: reply'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I get the following error when running the action:
Error: Label does not exist
(see this example)
The following request works:
curl --location --request DELETE 'https://api.github.com/repos/{user}/{repo}/issues/{issue}/labels/needs: reply' \
--header 'Authorization: token {token}'
For this reason, I assume that the error lies with the action.
Please let me know if you need more information.
Thank you very much!
For a step using this action something like this:
- name: Check to see if branch exists
id: branch-exists
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/git/ref/${{ env.BRANCH_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
the code seems to work, but I keep getting warnings like this:
<jobname>
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: octokit/request-action
Is there a way around this, or at least a way to temporarily suppress the warning until this action is re-written for Node.js 16?
I tried:
required_contexts: ""
β yaml does not complain but API doesrequired_contexts: false
β yaml does not complain but API doesrequired_contexts: []
β github action does not start, claims some syntax error in the yamlrequired_contexts: null
β github action does start despite the error, but sends undefined
instead of null
which ends in error (as shown)Could you have a look ?
( Already filed an issue here: SchemaStore/schemastore#1819 )
Dear all,
I am trying to upload a binary file to a release. I have retrieved the release structure in a previous step called rel
. This is what I have:
- uses: octokit/[email protected]
with:
route: POST ${{ fromJson(steps.rel.outputs.data).upload_url }}
name: mybinary
data: path/to/mybinary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
It works great except that the uploaded file does not contain the bytes of the file. Instead it contains the string path/to/mybinary
. So how can I actually upload a file?
PS: The whole pipeline is a little more complicated but I tried to condense it in a http://sscce.org/ manner.
When running action, warnings regarding the deprecation of set-output
appears.
Warning showed below:
Warning: The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Are there any plans for exchanging set-output
function invocations to echo "{name}={value}" >> $GITHUB_OUTPUT
Octokit.js v2.1.0
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
I'm trying to get repository details as per https://docs.github.com/en/rest/repos/repos#get-a-repository
Using a slightly modified example from the README:
steps:
- uses: octokit/[email protected]
id: get_latest_release
with:
route: GET /repos/{owner}/{repo}/
owner: octokit
repo: request-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I get:
Run octokit/[email protected]
GET /repos/{owner}/{repo}/
> owner: octokit
> repo: request-action
> mediaType: [object Object]
< 404 288ms
Error: Not Found
Debug log:
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Run octokit/request-action@v[2](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:2).x'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run octokit/[email protected]
##[debug]Loading inputs
Warning: Unexpected input(s) 'owner', 'repo', valid inputs are ['route', 'mediaType']
##[debug]Loading env
Run octokit/[email protected]
GET /repos/{owner}/{repo}/
> owner: octokit
> repo: request-action
> mediaType: [object Object]
##[debug]route: 'GET /repos/{owner}/{repo}/'
##[debug]parameters: { owner: 'octokit', repo: 'request-action', mediaType: {} }
##[debug]parsed request options: {
##[debug] method: 'GET',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v[3](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:3)+json',
##[debug] 'user-agent': 'octokit-action.js/[4](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:4).0.8 octokit-core.js/4.0.[5](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:5) Node.js/1[6](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:6).13.0 (linux; x64)'
##[debug] },
##[debug] request: { agent: undefined, hook: [Function: bound bound register] },
##[debug] data: undefined,
##[debug] url: 'https://api.github.com/repos/octokit/request-action/'
##[debug]}
< 404 28[7](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:7)ms
##[debug]RequestError [HttpError]: Not Found
##[debug] at /home/runner/work/_actions/octokit/request-action/v2.x/dist/index.js:10[8](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:8)5[9](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:9):21
##[debug] at processTicksAndRejections (node:internal/process/task_queues:96:5)
##[debug] at async main (/home/runner/work/_actions/octokit/request-action/v2.x/dist/index.js:[10](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:10)77:39) {
##[debug] status: 404,
##[debug] response: {
##[debug] url: 'https://api.github.com/repos/octokit/request-action/',
##[debug] status: 404,
##[debug] headers: {
##[debug] 'access-control-allow-origin': '*',
##[debug] 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
##[debug] connection: 'close',
##[debug] 'content-encoding': 'gzip',
##[debug] 'content-security-policy': "default-src 'none'",
##[debug] 'content-type': 'application/json; charset=utf-8',
##[debug] date: 'Wed, 02 Nov 2022 20:05:47 GMT',
##[debug] 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
##[debug] server: 'GitHub.com',
##[debug] 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
##[debug] 'transfer-encoding': 'chunked',
##[debug] vary: 'Accept-Encoding, Accept, X-Requested-With',
##[debug] 'x-content-type-options': 'nosniff',
##[debug] 'x-frame-options': 'deny',
##[debug] 'x-github-media-type': 'github.v3; format=json',
##[debug] 'x-github-request-id': '07C1:4421:4E83398:5073FB8:6362CD9B',
##[debug] 'x-ratelimit-limit': '15000',
##[debug] 'x-ratelimit-remaining': '14986',
##[debug] 'x-ratelimit-reset': '1667421698',
##[debug] 'x-ratelimit-resource': 'core',
##[debug] 'x-ratelimit-used': '14',
##[debug] 'x-xss-protection': '0'
##[debug] },
##[debug] data: {
##[debug] message: 'Not Found',
##[debug] documentation_url: 'https://docs.github.com/rest'
##[debug] }
##[debug] },
##[debug] request: {
##[debug] method: 'GET',
##[debug] url: 'https://api.github.com/repos/octokit/request-action/',
##[debug] headers: {
##[debug] accept: 'application/vnd.github.v3+json',
##[debug] 'user-agent': 'octokit-action.js/4.0.8 octokit-core.js/4.0.5 Node.js/16.[13](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:13).0 (linux; x64)',
##[debug] authorization: 'token [REDACTED]'
##[debug] },
##[debug] request: { agent: undefined, hook: [Function: bound bound register] }
##[debug] }
##[debug]}
Error: Not Found
##[debug]Node Action run completed with exit code 1
##[debug]Set output status = [40](https://github.com/SnowSoftwareGlobal/devops-github-workflows/actions/runs/3380752933/jobs/5613892047#step:3:41)4
##[debug]Finishing: Run octokit/[email protected]
I'm trying to download the contents of a file from another repo and I'm getting a rather unhelpful error. Nothing I've tried seems to help.
Action:
- name: Download Desktop Client Types
uses: octokit/[email protected]
id: get_desktop_client
with:
route: GET /repos/OWNER/REPO/contents/src/types/api.d.ts
mediaType: application/vnd.github.raw
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Run octokit/[email protected]
GET /repos/OWNER/REPORT/contents/src/types/api.d.ts
> mediaType: application/vnd.github.raw
(node:15[9](https://github.com/SpalkLtd/content-hub/runs/7891226272?check_suite_focus=true#step:3:10)1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Error: Cannot read property 'map' of undefined
closing in favor of octokit/core.js#323
Originally posted by @gr2m in octokit/rest.js#13 (comment)
node20
is now supported as runner (run.using
in action.yml), as per https://github.com/actions/runner/releases/tag/v2.308.0
No response
No response
No response
Hi,
I'm designing a workflow where I create a new repository. I'm using octokit/request-action to make the request:
steps:
- uses: octokit/[email protected]
id: create
with:
route: POST /orgs/{org}/repos
org: my-org
accept: 'application/vnd.github.v3+json'
name: repo-name
description: This is an automatically generated repo. Ignore me.
visibility: private
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
This works fine, but there are situations where the repo already exists. In that case the above will return the error Repository creation failed.: {"resource":"Repository","code":"custom","field":"name","message":"name already exists on this account"}
. Is there some way to ignore this error such that dependent jobs continue to execute? After all, the goal of having a repo with that name is fulfilled.
Thanks
Stefan
I'm getting this warning after my workflow complete running.How can I fix this please? by the way,I am running Github Action with terragrunt
Unexpected input(s) 'tf_action_version', valid inputs are ['entryPoint', 'args', 'tf_actions_subcommand', 'tf_actions_binary', 'tf_actions_version', 'tg_actions_version', 'tf_actions_cli_credentials_hostname', 'tf_actions_cli_credentials_token', 'tf_actions_comment', 'tf_actions_working_dir', 'tf_actions_fmt_write']
I am trying to create a pull-request with a multi-line body comment using octokit/request-action. However, the yaml.safeLoad
call is turning my multi-line string into a single line.
yaml.safeLoad
will output what typed instead of converting it?Here is what the action looks like in my workflow:
...
- name: Create pull-request against master
uses: octokit/[email protected]
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
route: POST /repos/:repository/pulls
repository: ${{ github.repository }}
title: Merge ght/master into master
head: ght/master
base: master
body: |
Modifications to ght/master were detected.
- [ ] Review the changes
- [ ] Fix the errors by committing back to ght/master
- [ ] Do **not** use Squash or Rebase
- [ ] Do **not** delete the ght/master branch
The log messages when that action runs looks like as follows:
POST /repos/:repository/pulls
> repository: sodre/turbo-memory
> title: Merge ght/master into master
> head: ght/master
> base: master
> body: Modifications to ght/master were detected. - [ ] Review the changes - [ ] Fix the errors by committing back to ght/master - [ ] Do **not** use Squash or Rebase - [ ] Do **not** delete the ght/master branch
< 201 1068ms
Rather than having to follow every request-action
step with a gr2m/[email protected]
to parse it, would it be possible for this action to accept those parsing requests directly? E.g.
- uses: octokit/[email protected]
id: get_latest_release
with:
route: GET /repos/:repository/releases/latest
repository: ${{ github.repository }}
tag_name: "data.tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run "echo Latest Tag: ${{ steps.get_latest_release.outputs.tag_name }}"
Hi team,
First of all, thank you for the efforts invested in creating this great action.
I am currently using the octokit/[email protected] action to turn off & on the branch protection. See the example below:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Branch protection OFF
uses: octokit/[email protected]
with:
route: PUT /repos/:repository/branches/develop/protection
repository: ${{ github.repository }}
required_status_checks: |
null
enforce_admins: |
null
required_pull_request_reviews: |
null
restrictions: |
null
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Commit
run: |
git add myfolder
git config user.name "MyUsername"
git config user.email "MyEmail"
git commit -m 'MyCommitMessage'
git push $REPOSITORY
- name: Branch protection ON
uses: octokit/[email protected]
with:
route: PUT /repos/:repository/branches/develop/protection
repository: ${{ github.repository }}
required_status_checks: |
null
enforce_admins: |
null
required_pull_request_reviews: |
dismiss_stale_reviews: false
required_approving_review_count: 2
restrictions: |
null
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
The action works perfectly but I would have a question on the required_status_checks property: Would you have an example on how to fill this field ? My required status check is called "Validate PR" and tried to add it in the Branch protection ON action as you can see below, but without any luck.
- name: Branch protection ON
uses: octokit/[email protected]
with:
route: PUT /repos/:repository/branches/develop/protection
repository: ${{ github.repository }}
required_status_checks: |
Validate PR
also
required_status_checks: |
'Validate PR'
Pipeline logs:
Run octokit/[email protected]
with:
route: PUT /repos/:repository/branches/develop/protection
repository: MCBC-Org/beermate-salesforce
required_status_checks: Validate PR
enforce_admins: null
required_pull_request_reviews: dismiss_stale_reviews: false
required_approving_review_count: 2
restrictions: null
mediaType: {}
env:
GITHUB_TOKEN: ***
PUT /repos/:repository/branches/develop/protection
enforce_admins: null
mediaType: [object Object]
repository: MCBC-Org/beermate-salesforce
required_pull_request_reviews: [object Object]
required_status_checks: Validate PR
restrictions: null
< 422 220ms
Error: Invalid request.
No subschema in "anyOf" matched.
For 'allOf/0', "Validate PR" is not an object.
Not all subschemas of "allOf" matched.
For 'anyOf/1', "Validate PR" is not a null.
No response
2.x
No response
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
semantic-release cannot push the version tag to the branch master
on the remote Git repository with URL https://x-access-token:[secure]@github.com/octokit/request-action
.
This can be caused by:
Good luck with your project β¨
Your semantic-release bot π¦π
Can we please support onprem github api calls?
Thanks
No response
No response
No response
Warning: Unexpected input(s) 'owner', 'repo', valid inputs are ['route', 'mediaType']
Run octokit/request-action@v[2](https://github.com/***/***/actions/runs/5168372820/jobs/9309914439#step:2:2).x
with:
route: GET /repos/{owner}/{repo}/releases/latest
owner: ***
repo: ***
mediaType: {}
env:
GITHUB_TOKEN: ***
GET /repos/{owner}/{repo}/releases/latest
> owner: ****
> repo: ******
> mediaType: [object Object]
< [4](https://github.com/***/***/actions/runs/5168372820/jobs/9309914439#step:2:4)01 21[9](https://github.com/***/***/actions/runs/5168372820/jobs/9309914439#step:2:9)ms
Error: Bad credentials
octokit/[email protected]
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.