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

Action doesn't fail in case of errors #16

Open
AleksMat opened this issue Aug 2, 2022 · 0 comments
Open

Action doesn't fail in case of errors #16

AleksMat opened this issue Aug 2, 2022 · 0 comments

Comments

@AleksMat
Copy link

AleksMat commented Aug 2, 2022

Hi @SvanBoxel,

Thanks for this great action. The only problem is that the action doesn't fail in case if anything doesn't work in the process of interacting with Gitlab. I'm running the action with the standard parameters written in Readme, including using the master version of the code:

uses: SvanBoxel/gitlab-mirror-and-ci-action@master

When everything is configured correctly on Gitlab the action works great. But when something expires the action still pretends everything works with a success status. Here are logs from 2 of such cases:

  • A Gitlab access token expires:
Switched to a new branch 'my-branch'
Branch 'my-branch' set up to track remote branch 'my-branch' from 'origin'.
pushing to my-branch branch at <my gitlab repo>
remote: HTTP Basic: Access denied
fatal: Authentication failed for '<my gitlab repo>'
Triggered CI for branch my-branch
Working with pipeline id #null
Poll timeout set to 10
Current pipeline status: null
Pipeline finished with status null
Fetching all GitLab pipeline jobs involved
jq: error (at <stdin>:0): Cannot index string with string "id"
Posting output from all GitLab pipeline jobs
Debug problems by unfolding stages/jobs above
  • Push to Gitlab fails because the given access token doesn't have a permission to push to a protected branch:
Switched to a new branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
pushing to master branch at <my gitlab repo>
warning: redirecting to <my gitlab repo>
remote: GitLab: You are not allowed to push code to protected branches on this project.
To <my gitlab repo>
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '<my gitlab repo>'
Triggered CI for branch master
Working with pipeline id #167976
Poll timeout set to 10
Current pipeline status: success
Pipeline finished with status success
Fetching all GitLab pipeline jobs involved
Posting output from all GitLab pipeline jobs
Stage test / Job my_integration_job
Debug problems by unfolding stages/jobs above
{
  "message": "Resource not accessible by integration",
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-commit-status"
}

(Note: in the above logs I just masked the actual gitlab repo link as it is not important for debugging.)

This is probably very related to #10

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

1 participant