Skip to content
Snippets Groups Projects
Commit e9b08231 authored by Dylan Aïssi's avatar Dylan Aïssi Committed by Andrej Shadura
Browse files

get_job_artifacts_link.py: validate url by using JOB-TOKEN as header


To be consistent with the LAVA job which retrieve artifacts by
passing CI_JOB_TOKEN in header of curl request.

Signed-off-by: default avatarDylan Aïssi <dylan.aissi@collabora.com>
parent 3342af4b
No related branches found
No related tags found
1 merge request!591Fix token usage for private git repositories and retrieve source package from the build-source job instead of obs-capture
......@@ -5,7 +5,7 @@ import argparse
import requests
def validate_url(url_base, token):
headers = {'gitlab-ci-token': token}
headers = {'JOB-TOKEN': token}
r = requests.get(url_base, headers=headers)
......@@ -26,12 +26,7 @@ def main():
project_path = requests.utils.quote(args.project_path, safe='')
url_base = 'https://'
if args.token:
url_base += f'{args.token}@'
url_base += f'{args.gitlab_server}/api/v4/projects'
url_base = f'https://{args.gitlab_server}/api/v4/projects'
obs_results_url = f'{url_base}/{project_path}/jobs/{args.job_id}/artifacts'
validate_url(obs_results_url, args.token)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment