Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BioFlow-Insight
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shareFAIR
BioFlow-Insight
Commits
97f3b761
Commit
97f3b761
authored
10 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
updated github api request with authentication
parent
fde3727c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#13874
passed with stage
in 1 minute and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/workflow.py
+9
-3
9 additions, 3 deletions
src/workflow.py
with
9 additions
and
3 deletions
src/workflow.py
+
9
−
3
View file @
97f3b761
...
@@ -45,7 +45,8 @@ class Workflow:
...
@@ -45,7 +45,8 @@ class Workflow:
license
=
None
,
creativeWorkStatus
=
None
,
authors
=
None
,
license
=
None
,
creativeWorkStatus
=
None
,
authors
=
None
,
version
=
None
,
keywords
=
None
,
producer
=
None
,
version
=
None
,
keywords
=
None
,
producer
=
None
,
publisher
=
None
,
processes_2_remove
=
None
,
publisher
=
None
,
processes_2_remove
=
None
,
processes_annotation
=
None
):
processes_annotation
=
None
,
personnal_acces_token
=
None
):
if
(
not
os
.
path
.
isfile
(
file
)):
if
(
not
os
.
path
.
isfile
(
file
)):
nextflow_files
=
glob
.
glob
(
f
'
{
file
}
/*.nf
'
)
nextflow_files
=
glob
.
glob
(
f
'
{
file
}
/*.nf
'
)
...
@@ -54,7 +55,7 @@ class Workflow:
...
@@ -54,7 +55,7 @@ class Workflow:
try
:
try
:
file
=
'
/
'
.
join
(
nextflow_files
[
0
].
split
(
'
/
'
)[:
-
1
])
+
"
/main.nf
"
file
=
'
/
'
.
join
(
nextflow_files
[
0
].
split
(
'
/
'
)[:
-
1
])
+
"
/main.nf
"
with
open
(
file
,
'
r
'
)
as
f
:
with
open
(
file
,
'
r
'
)
as
f
:
txt
=
f
.
read
()
txt
=
f
.
read
()
except
:
except
:
file
=
nextflow_files
[
0
]
file
=
nextflow_files
[
0
]
...
@@ -80,6 +81,7 @@ class Workflow:
...
@@ -80,6 +81,7 @@ class Workflow:
self
.
keywords
=
keywords
self
.
keywords
=
keywords
self
.
producer
=
producer
self
.
producer
=
producer
self
.
publisher
=
publisher
self
.
publisher
=
publisher
self
.
personnal_acces_token
=
personnal_acces_token
if
(
processes_2_remove
==
""
):
if
(
processes_2_remove
==
""
):
processes_2_remove
=
None
processes_2_remove
=
None
self
.
processes_2_remove
=
processes_2_remove
self
.
processes_2_remove
=
processes_2_remove
...
@@ -172,7 +174,11 @@ class Workflow:
...
@@ -172,7 +174,11 @@ class Workflow:
current_directory
=
os
.
getcwd
()
current_directory
=
os
.
getcwd
()
os
.
chdir
(
self
.
get_repo_adress
())
os
.
chdir
(
self
.
get_repo_adress
())
try
:
try
:
_
=
os
.
system
(
f
"
wget -qO - https://api.github.com/repos/
{
self
.
address
}
> temp_dico_
{
id
(
self
)
}
.json
"
)
if
(
self
.
personnal_acces_token
!=
None
):
command
=
f
'
curl --silent --request GET --url
"
https://api.github.com/repos/
{
self
.
address
}
"
--header
"
Authorization: Bearer
{
self
.
personnal_acces_token
}
"
--header
"
X-GitHub-Api-Version: 2022-11-28
"
> temp_dico_
{
id
(
self
)
}
.json
'
else
:
command
=
f
'
curl --silent --request GET --url
"
https://api.github.com/repos/
{
self
.
address
}
"
> temp_dico_
{
id
(
self
)
}
.json
'
_
=
os
.
system
(
command
)
with
open
(
f
'
temp_dico_
{
id
(
self
)
}
.json
'
)
as
json_file
:
with
open
(
f
'
temp_dico_
{
id
(
self
)
}
.json
'
)
as
json_file
:
self
.
dico
=
json
.
load
(
json_file
)
self
.
dico
=
json
.
load
(
json_file
)
os
.
system
(
f
"
rm temp_dico_
{
id
(
self
)
}
.json
"
)
os
.
system
(
f
"
rm temp_dico_
{
id
(
self
)
}
.json
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment