debian-mirror-gitlab/spec/contracts/consumer/resources/api/project/pipelines.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
739 B
JavaScript
Raw Permalink Normal View History

2022-08-27 11:52:29 +05:30
import axios from 'axios';
export async function getProjectPipelines(endpoint) {
const { url } = endpoint;
return axios({
method: 'GET',
baseURL: url,
url: '/gitlab-org/gitlab-qa/-/pipelines.json',
headers: { Accept: '*/*' },
params: {
scope: 'all',
page: 1,
},
}).then((response) => response.data);
}
export async function postProjectPipelines(endpoint) {
const { url } = endpoint;
return axios({
method: 'POST',
baseURL: url,
url: '/gitlab-org/gitlab-qa/-/pipelines',
headers: {
Accept: '*/*',
'Content-Type': 'application/json; charset=utf-8',
},
data: { ref: 'master' },
validateStatus: (status) => {
return status === 302;
},
});
}