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

Could not resolve host #4

Open
osmollo opened this issue Sep 3, 2020 · 2 comments
Open

Could not resolve host #4

osmollo opened this issue Sep 3, 2020 · 2 comments

Comments

@osmollo
Copy link

osmollo commented Sep 3, 2020

Hi,

I'm executing your github action with this code:

    - name: send md5sum file to gitlab release
      uses: wei/curl@v1
      with:
        args: "-X POST \"https://gitlab.com/api/v4/projects/XXX/releases/A.B.C/assets/links\" -H \"Private-Token: ${{ secrets.GITLABTOKEN }}\" --data name=\"file1\" --data url=\"https://github.com/me/XXX/releases/download/A.B.C/file1\""

But when it runs:

/usr/bin/docker run --name blablabla --label blablabla --workdir /github/workspace --rm [...] blablabla -X POST "https://gitlab.com/api/v4/projects/XXX/releases/A.B.C/assets/links" -H "Private-Token: ***" --data name="file1" --data url="https://github.com/ME/gorkscrew/XXX/download/A.B.C/file1"
curl: (22) The requested URL returned error: 403 
curl: (6) Could not resolve host: ***

With another actions, i've installed packages from repositories and download files from internet, so there's no problem with internet access. Could you try to resolv gitlab.com domain inside your container? Could you guess what's happening?

Thanks and best regards

@ise
Copy link

ise commented Nov 13, 2020

@ohermosa

Maybe you should remove double quotes.

    - name: send md5sum file to gitlab release
      uses: wei/curl@v1
      with:
        args: -X POST \"https://gitlab.com/api/v4/projects/XXX/releases/A.B.C/assets/links\" -H \"Private-Token: ${{ secrets.GITLABTOKEN }}\" --data name=\"file1\" --data url=\"https://github.com/me/XXX/releases/download/A.B.C/file1\"

@boly38
Copy link

boly38 commented Mar 7, 2021

Hi here

I just success to pass header args by doing the following:

  • escaping double quotes like @ise suggested 👍
  • using multi-line syntax (to prevent syntax error)

So this gives the following result:

    - name: send curl with header
      uses: wei/curl@v1
      with:
        args: |
          -H \"My-Token: ${{ secrets.MY_TOKEN}}\" -X POST https://mywebhook.exemple.com

So fixing this issue may be to only update readme file to provide this kind of sample.

triffon added a commit to triffon/fp-slides that referenced this issue Dec 4, 2021
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

3 participants