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
Cannot find hash of last commit on branch "main" #4
Comments
I think it could be fixed by rebuilding because then npm installs the latest Caprover CLI which fixed the bug. |
Hi, got exactly the same issue. Deployment to caprover fails. |
I used a workaround, it might not be as fast, but it always uses the latest version. Replace the action: - name: Caprover Deploy
uses: AlexxNB/caprover-action@v1
with:
server: 'https://example.com'
password: '${{ secrets.CAPROVER_PASSWORD }}'
appname: 'myapp'
branch: 'main' With the following code that installs the Caprover CLI in the pipeline and deploys your app. - name: Set up npm
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install caprover
run: npm install -g caprover
- name: Caprover Deploy
run: caprover deploy -h 'https://example.com' -p '${{ secrets.CAPROVER_PASSWORD }}' -b 'main' -a 'myapp' |
Works fine! Not that slow, thanks! |
After a little investigation, the bug is caused by this line. The problem is that the Github checkout action only pulls the latest hash which causes an issue with uses: actions/checkout@v2
with:
fetch-depth: 0 However,I realized after benchmarking that installing the Caprover CLI in the pipeline as mentioned in my comment before is a much better solution than using this action because it only takes 13 seconds. This action takes 28 seconds and it is already based on alpine, so it cannot be improved a lot. 13 second solution (without action):- name: Set up npm
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install caprover
run: npm install -g caprover
- name: Caprover Deploy
run: caprover deploy -h 'https://example.com' -p '${{ secrets.CAPROVER_PASSWORD }}' -b 'main' -a 'myapp' |
Thanks @Alwinator ! |
After two days of trial and error and trying above methods, I couldn't get to work. - name: Checkout to branch
run: |
git fetch origin ${{ github.head_ref }}
git checkout ${{ github.head_ref }} |
Thank you for your instructions, I followed it and it worked. |
You caprover action worked great for month, but for one week it does not work with the following exception:
The text was updated successfully, but these errors were encountered: