-
Notifications
You must be signed in to change notification settings - Fork 48
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
First deploy of branch fails #116
Comments
I see this exact same error too. Another action that does a similar thing also has the same behavior: jitterbit/get-changed-files#10 Any resolution to the issue? |
@shaunaa126 , what we ended up doing is using name: Get changed files
id: getfile
run: |
if [[ is_the_first_deployment ]]; then
export DIFF=$( git diff --name-only origin/name-of-some-branch ${{ github.sha }} )
echo "Diff between origin/name-of-some-branch and ${{ github.sha }} "
else
export DIFF=$( git diff --name-only ${{ github.event.before }} ${{ github.sha }} )
echo "Diff between ${{ github.event.before }} and ${{ github.sha }} "
fi
echo "::set-output name=files::$( echo "$DIFF" | sed ':a;N;$!ba;s/\n/%0A/g' )" How you set the Later on you can parse this string in JavaScript: const allFiles = `${{ steps.getfile.outputs.files }}`
.split('\n')
.map(str => str.trim())
.filter(Boolean); |
Thank you for this @micahjon |
Same error here. |
I also got the same error using that action as well: #116 (comment) |
Finally got the same error with commitid: |
I also got into this and was so confused because it was working on one project but not another one and I found out how to handle it: It seems the source code is here https://github.com/jitterbit/get-changed-files/blob/master/src/main.ts#L28-L36
on:
push:
branches:
# Push events our default branch
- main
# Push events to branches matching refs/heads/renovate/...
- 'renovate/**'
pull_request:
paths-ignore:
- '*.md'
- 'renovate.json' It makes sense to me as a new branch does not have a base / reference where it's from, it's "floating" around, it's when creating the PR that the base branch is selected. A solution could be to always diff on the default branch, another could be to document this ⬆️ Originally posted by @Jolg42 in Ana06/get-changed-files#12 (comment) |
This action fails on first commit for push events. Apply some of proposals seen in their issue thread: trilom/file-changes-action#116
This action fails on first commit for push events. Apply some of proposals seen in their issue thread: trilom/file-changes-action#116
This action fails on first commit for push events. Apply some of proposals seen in their issue thread: trilom/file-changes-action#116
This action fails on first commit for push events. Apply some of proposals seen in their issue thread: trilom/file-changes-action#116
This action fails on first commit for push events. Apply some of proposals seen in their issue thread: trilom/file-changes-action#116
This action fails on first commit for push events. Apply some of proposals seen in their issue thread: trilom/file-changes-action#116
As you can see in test made above it doesn't work for me setting branches if any git feature workflows are adopted, especially if in you fork a repo and enable GitHub Actions |
@davorpa I didn't check in detail, the problem might be similar but different here 🤔 I thought this I can recommend you to try out https://github.com/Ana06/get-changed-files, it's the one I'm currently using since a few months. |
Same error here. Any workaround ? |
Is this action supposed to work when deploying a new branch for the first time (ideally diffing against a different branch)? Or does it only compare commits within the same branch?
We're running into an issue where it fails every time we deploy a branch for the first time. Subsequent deploys to the same branch (which is no longer a new branch at that point) work just fine.
Thanks!
undefined Exception: { "error": "404/HttpError", "from": "undefined/Error", "message": "There was an error getting change files for repo:test-repo owner:test-owner base:0000000000000000000000000000000000000000 head:e966d6f2925816a0d97d45fa30b52840cfe3e79f", "payload": { "name": "HttpError", "status": 404, "headers": { "access-control-allow-origin": "*", "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", "connection": "close", "content-encoding": "gzip", "content-security-policy": "default-src 'none'", "content-type": "application/json; charset=utf-8", "date": "Wed, 10 Feb 2021 17:22:47 GMT", "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "server": "GitHub.com", "strict-transport-security": "max-age=31536000; includeSubdomains; preload", "transfer-encoding": "chunked", "vary": "Accept-Encoding, Accept, X-Requested-With", "x-content-type-options": "nosniff", "x-frame-options": "deny", "x-github-media-type": "github.v3; format=json", "x-github-request-id": "BBB8:50DF:1FD85:51579:60241667", "x-ratelimit-limit": "1000", "x-ratelimit-remaining": "999", "x-ratelimit-reset": "1612981367", "x-ratelimit-used": "1", "x-xss-protection": "1; mode=block" }, "request": { "method": "GET", "url": "https://api.github.com/repos/test-owner/test-repo/compare/0000000000000000000000000000000000000000...e966d6f2925816a0d97d45fa30b52840cfe3e79f", "headers": { "accept": "application/vnd.github.v3+json", "user-agent": "octokit.js/16.43.1 Node.js/12.13.1 (Linux 4.15; x64)", "authorization": "token [REDACTED]" }, "request": {} }, "documentation_url": "https://docs.github.com/rest/reference/repos#compare-two-commits" } }
The text was updated successfully, but these errors were encountered: