Closed louis-l closed 2 years ago
I'd suggest you post the issue here: https://github.com/AlexxNB/caprover-action
I thought about it, but then I check that action and its only job is to run caprover deploy ...
command. So I thought it had something to do with the Caprover CLI.
There is more to it. What's version of git? What environment it's running in? etc.
Can you reproduce it locally using caprover deploy
?
I just tested caprover deploy
locally and it worked.
This is my deploy yml file:
name: CapRover Deployment
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: CapRover Deploy
uses: AlexxNB/caprover-action@v1
with:
server: ${{secrets.CAPROVER_SERVER}}
password: ${{secrets.CAPROVER_PASSWORD}}
appname: ${{secrets.CAPROVER_APPNAME}}
branch: master
- name: Slack Notification
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
uses: act10ns/slack@v1.5.0
with:
status: ${{ job.status }}
if: always()
Again, it was working fine. Just today it stops working.
I checked AlexxNB/caprover-action@v1
repo and it has not been changed in 2 years.
node:12-alpine
(see https://github.com/AlexxNB/caprover-action/blob/master/Dockerfile)Then it's something that changed on Github runners. Perhaps a different git version. Requires debugging. Try running this in your github runner and see what it prints:
git rev-parse master
This is my test:
name: CapRover Deployment
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Test git command 🧪
run: git rev-parse master
- name: CapRover Deploy
uses: AlexxNB/caprover-action@v1
with:
server: ${{secrets.CAPROVER_SERVER}}
password: ${{secrets.CAPROVER_PASSWORD}}
appname: ${{secrets.CAPROVER_APPNAME}}
branch: master
- name: Slack Notification
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
uses: act10ns/slack@v1.5.0
with:
status: ${{ job.status }}
if: always()
and here is the output:
Hmm.. that's exactly what caprover deploy
does... Not sure what's happening here
https://github.com/caprover/caprover-cli/blob/3f93fb79e3fba0afc7bbc48a01edb69103db3f05/src/utils/ValidationsHandler.ts#L171-L180
P/S: here is the logs from Github action when building the AlexxNB/caprover-action@v1
:
Seems like its running the latest caprover 2.2.3
Yeh, that's weird. Is there anything I can do to/provide to help?
You'd have to fork the action that you're using and debug it by running git rev-parse master
before caprover deploy
@githubsaturn
I created a folk here: https://github.com/louis-l/caprover-action/blob/master/run.sh
However, I could not get it to print out the result.
This is the output:
Googled around and could not find a solution. Can you give advice please?
I managed to update Dockerfile from node:12-alpine
to node:14-alpine
and added CMD git rev-parse master
.
and here is the output:
Still not working and still could not get it to print out the git command result.
Your dockerfile here is wrong:
Move the git rev-parse master
line to the run.sh
file, not the dockerfile.
It was in run.sh
before but I could not get it to print the output out to Github Action console.
This is what I tried in run.sh
:
git rev-parse master
caprover deploy -h $INPUT_SERVER -p $INPUT_PASSWORD -b $INPUT_BRANCH -a $INPUT_APPNAME
and the result was posted in https://github.com/caprover/caprover-cli/issues/119#issuecomment-1101939084
Then you'll have to find out why git rev-parse master
doesn't print anything on the github runner. At that point, it hasn't even reached CapRover code. That aside, it's very bizarre that it doesn't print anything, not even an error.
Thanks for your time @githubsaturn I gave up here 😔 Dont know where to look.
There is also floms/action-caprover - I see some people using this. Try it out, it might work.
Thanks @githubsaturn
I tried that action and it worked 😯 Presumably, the issue lies in the OS and git version.
Anw, all good now. Thanks for your time again.
Hi there,
I have been using
AlexxNB/caprover-action@v1
to auto deploy on push for ages, but today it stops working. I checked the Github action log and the last log was Cannot find hash of last commit on branch "master".Here is the screenshot:![Screen Shot 2022-04-19 at 9 03 39 am](https://user-images.githubusercontent.com/10172565/163890887-d7a2adb1-16cd-447b-9a1c-16d15421f8af.png)
I googled and found nothing exception this code: https://github.com/caprover/caprover-cli/blob/master/src/utils/ValidationsHandler.ts#L181
Can anyone shed some light here?
Cheers,