"Error: timeout of 600000ms exceeded" in github build with ghost inspector tests - github

I have the below error in github build with ghost inspector tests
"Error: timeout of 600000ms exceeded"
I tried maxTimeout in git build .yml file. But it's not working.
https://ghostinspector.com/docs/integration/github-actions/
If anyone knows this solution share it with me.

Instead of changing the concurrency in the ghostinpector, you can use the ghostinprctor-cli for run the git actions.
Ex:
https://ghostinspector.com/docs/api/cli/
- uses: docker://ghostinspector/cli
with:
args: suite execute ${{ secrets.GI_SUITE }} \
--apiKey ${{ secrets.GI_API_KEY }} \
--errorOnFail
secrets.GI_SUITE and secrets.GI_API_KEY are the ghostinspector API and SUITE keys. you can get those from the ghostinspector settings
secrets and the github secrets https://docs.github.com/en/actions/security-guides/encrypted-secrets

The above issue has based on concurrency limitations.
Previously I used 25 tests that not working.
Now I changed that 50 tests. Now, maxTimeout=600000ms is working correctly for me.

Related

How can I use web-deploy on github actions?

I have my domain and my hosting through one.com and I'm tired of moving individual files through filezilla and wanted to automate that process using github actions.
I guess I'll start out by saying I'm completely new to this and this is my first time trying to setup an action. Basically what I want is to just push the code to my github repo and then it gets build and sent to my host. Kinda like how it is with Netlify.
I stumbled upon this https://github.com/SamKirkland/web-deploy which should do the trick. I've seen tutorials using this method on youtube, but I guess they have a different provider than I do making it easier.
This is what information I have to go off of and I hope it will be enough to set it up:
Host: ssh.one-example.com
Username: one-example.com
Password: the one you chose for SSH in your Control Panel
Port: 22
and this is what I put in the yml file:
on:
push:
branches:
- main
name: Publish Website
jobs:
web-deploy:
name: πŸš€ Deploy Website Every Commit
runs-on: ubuntu-latest
steps:
- name: 🚚 Get Latest Code
uses: actions/checkout#v3
- name: πŸ“‚ Sync Files
uses: SamKirkland/web-deploy#v1
with:
target-server: ${{ secrets.ftp_host }}
remote-user: ${{ secrets.ftp_username }}
private-ssh-key: ${{ secrets.ftp_password }}
destination-path: ~/destinationFolder/
I've tried having the target server both be ssh.one-example.com (obviously using my own here) and I've tried one-example.com#ssh.one-example.com
But I'm ending up with the following error when the action is running:
Error: Error: The process '/usr/bin/rsync' failed with exit code 255
So safe to say I'm a little lost and would like some guidance on how to make it work. Is it what I'm typing that's the issue, is it the host? And if so how do I fix it?
Any help is much appreciated.
Try an SSH action first, to see if you actually can open an SSH session. This is just for testing the connection: try and execute on the remote server a trivial command (ls, or pwd)
Then, regarding your current original action, check the error messages before your "The process '/usr/bin/rsync' failed with exit code 255".
See as an example of previous error messages SamKirkland/web-deploy issue 5 (not yet resolved).

Ensure that a workflow in Github Actions is only ever triggered once

I have workflow that is triggered when a specific file is changed. Is it possible to ensure that this workflow is only triggered the first time that file is changed?
The use case is:
a repository is created from a template repository
to initialize the README and other things in the repo, some variables can be set in a JSON config file
once that file is committed, the workflow runs, creates the README from a template etc.
I have tried to do let the workflow delete itself before it commits and pushes the changed files. That doesn't work: fatal: not in a git directory and fatal: unsafe repository ('/github/workspace' is owned by someone else).
What might work is adding a topic like initialized to the repo at the end of the workflow and check for the presence of this topic at the beginning of the workflow. However, this is feels like a hack in that I'm abusing topics for something they're probably not meant to do.
So my question remains: is there a good way to only run the workflow once?
With the help of the comment by frennky I managed to do solve this by using the GitHub CLI to disable the workflow.
Here is the step at the end of the workflow that does this:
- name: Disable this workflow
shell: bash
run: |
gh workflow disable -R $GITHUB_REPOSITORY "${{ github.workflow }}"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

github actions "The key 'concurrency' is not allowed."

I want to cancel the previous run when a new run is executed.
So, referring to the https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency document, I added the concurrency keyword.
Below is my sample code.
name: test
on:
push:
branches:
- feature/**
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
~~~
However, when executing the action, an error saying "The key 'concurrency' is not allowed" is thrown and it does not work. The examples on google are no different from my sample code. What is the cause?
(If the concurrency keyword is removed, the action works normally.)
Tried the code you provided and it worked for me with no issue. Not sure what the problem is on your side. Are you running this on a GitHub-provided runner or are you self-hosting one? Can't gauge that since you job description is missing. Also do you have a link to the repository maybe?
Something to try would be to add the concurrency key on the job level instead of the global level. Maybe that changes things for you

github actions get URL of test build

I can't seem to find out how to get the URL of a test workflow anywhere in the docs. I have a simple job which runs tests and on fail it needs to post the URL of the failed job to another web service.
I was expecting this to be in the default env vars but apparently not.
Thanks,
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
This was originally suggested in this post on GH forum.
Am convinced there is nothing about this in the docs, but I eventually found that this works:
https://github.com/<name>/<repo>/commit/$GITHUB_SHA/checks
You can get the GitHub Action URL for the particular commit by formulating the URL like the example below for a shell script step.
- name: Run shell cmd
run: echo "https://github.com/${{github.repository}}/commit/${{github.sha}}/checks/${{github.run_id}}"
Alternatively, GitHub action provides the env's as GITHUB_REPOSITORY, GITHUB_SHA, GITHUB_RUN_ID in each step and only need to construct the URL in the above pattern.

Azure Pipepline with task Sonarqube https

I added a Sonarqube task into my azure build pipeline, in order to login to my sonarqube server I need to run a command, which uses trunst store ssl.
my pipeline looks just like this:
- task: SonarSource.sonarqube.15B84CA1-B62F-4A2A-A403-89B77A063157.SonarQubePrepare#4
displayName: 'Prepare analysis on SonarQube'
inputs:
SonarQube: abc-sonarqube
scannerMode: CLI
configMode: manual
cliProjectKey: 'abc'
cliProjectName: 'abc'
cliSources: src
extraProperties: |
sonar.host.url=https://sonarqube.build.abcdef.com
sonar.ce.javaAdditionalOpts=-Djavax.net.ssl.trustStore=mvn/sonar.truststore -Djavax.net.ssl.trustStorePassword=changeit
I am not sure, if this command "sonar.ce.javaAdditionalOpts=-Djavax.net.ssl.trustStore=mvn/sonar.truststore -Djavax.net.ssl.trustStorePassword=changeit" correct is.
I got the error "API GET '/api/server/version' failed, error was: {"code":"UNABLE_TO_VERIFY_LEAF_SIGNATURE"}
"
PS: my project is angular project.
any solutions?
Azure Pipepline with task Sonarqube https
This issue should be related in how the configure task works. So, even if we add the certificate to the java trustore, the task that sets the configuration uses a different runtime (not java at least) to communicate with the server, that’s why you still get that certificate error.
To resolve this issue, you could try to:
set a global variable, NODE_EXTRA_CA_CERTS, and set it to a copy of
the root cert we had stored locally in a directory. See this article.
Check the related ticket for some more details.
Hope this helps.