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

Problem updating formula via PR - code 302 #11

Closed
nimrodkor opened this issue Nov 28, 2020 · 3 comments
Closed

Problem updating formula via PR - code 302 #11

nimrodkor opened this issue Nov 28, 2020 · 3 comments

Comments

@nimrodkor
Copy link

nimrodkor commented Nov 28, 2020

Hi!

I'm trying this sweet action to update the checkov formulae, and getting this error on every run:

/home/runner/work/_actions/mislav/bump-homebrew-formula-action/v1/lib/index.js:3165
                throw new Error(`HTTP ${res.statusCode}`);
                ^

Error: HTTP 302
    at ClientRequest.<anonymous> (/home/runner/work/_actions/mislav/bump-homebrew-formula-action/v1/lib/index.js:3165:23)
    at Object.onceWrapper (events.js:300:26)
    at ClientRequest.emit (events.js:210:5)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
    at TLSSocket.socketOnData (_http_client.js:456:22)
    at TLSSocket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)

Any pointers to what I should do?

@nimrodkor nimrodkor changed the title Problem updating formula via PR Problem updating formula via PR - code 302 Nov 28, 2020
@mislav
Copy link
Owner

mislav commented Nov 30, 2020

Thanks for reporting! I have no idea what's happening. It looks like there is a 302 response when we were expecting a HTTP 200. To be clear, this line runs after we've already manually followed a 30x redirect, so I'm not sure why there is another redirect.

I've pushed an update to this action to enable JavaScript source maps (so that stack traces are ideally clearer and map to our source files), and you may try to re-run your workflow after you've set ACTIONS_RUNNER_DEBUG and ACTIONS_STEP_DEBUG secrets in your repository to true. This should generate a more verbose log from your workflow run, and if that works, please share it here!

@nimrodkor
Copy link
Author

Sure!

I tried it, here's the complete log output:

1s
##[debug]Evaluating: secrets.PAT_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'PAT_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Run mislav/bump-homebrew-formula-action@v1'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run mislav/bump-homebrew-formula-action@v1
##[debug]Loading inputs
##[debug]Loading env
Run mislav/bump-homebrew-formula-action@v1
  with:
    formula-name: checkov
    homebrew-tap: Homebrew/homebrew-core
    commit-message: {{formulaName}} {{version}}
  
  Created by https://github.com/mislav/bump-homebrew-formula-action
  
  env:
    COMMITTER_TOKEN: ***

/home/runner/work/_actions/mislav/bump-homebrew-formula-action/v1/src/calculate-download-checksum.ts:13
                throw new Error(`HTTP ${res.statusCode}`);
^
Error: HTTP 302
    at ClientRequest.<anonymous> (/home/runner/work/_actions/mislav/bump-homebrew-formula-action/v1/src/calculate-download-checksum.ts:13:1)
    at Object.onceWrapper (events.js:300:26)
    at ClientRequest.emit (events.js:210:5)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
    at TLSSocket.socketOnData (_http_client.js:456:22)
    at TLSSocket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)
##[debug]GET https://github.com/bridgecrewio/checkov/archive/refs/pull/699/merge.tar.gz
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Run mislav/bump-homebrew-formula-action@v1

@mislav
Copy link
Owner

mislav commented Nov 30, 2020

@nimrodkor Okay, so here is the error: https://github.com/bridgecrewio/checkov/archive/refs/pull/699/merge.tar.gz

The ref pull/699/merge is not a valid git tag. This action cannot be initiated from a pull_request event. It is only designed to work from a push event to a git tag.

To test it out in your repository, you would need to push to a temporary tag. When #9 ships, it might be easier to test the action without creating a git tag.

@mislav mislav closed this as completed Nov 30, 2020
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