-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: One commit and PR per proposed change
- Loading branch information
Showing
7 changed files
with
179 additions
and
116 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 |
---|---|---|
@@ -1 +1,8 @@ | ||
# create-infrastructure-pr | ||
# create-infrastructure-pr | ||
|
||
``` | ||
node cli.js --owner livingdocsIO --repo infrastructure-onboarding-service \ | ||
--infrastructure-path onboarding-service --release-branch release-2024-11-16 --env stage \ | ||
--tag v4.20.11 --customer onboarding \ | ||
--gh-token your-github-token | ||
``` |
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const request = require('request-promise') | ||
|
||
module.exports = async ({owner, repo, token, content}) => { | ||
const options = { | ||
method: 'POST', | ||
uri: `https://api.github.com/repos/${owner}/${repo}/git/blobs`, | ||
headers: { | ||
'User-Agent': 'Request-Promise', | ||
'Authorization': `Bearer ${token}`, | ||
'Accept': 'application/vnd.github+json' | ||
}, | ||
body: { | ||
content: content, | ||
encoding: 'base64' | ||
}, | ||
json: true | ||
} | ||
return request(options) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const request = require('request-promise') | ||
|
||
module.exports = async ({owner, repo, token, message, tree, parents}) => { | ||
try { | ||
const options = { | ||
method: 'POST', | ||
uri: `https://api.github.com/repos/${owner}/${repo}/git/commits`, | ||
headers: { | ||
'User-Agent': 'Request-Promise', | ||
'Authorization': `token ${token}`, | ||
'Accept': 'application/vnd.github.v3+json' | ||
}, | ||
body: { | ||
message: message, | ||
tree: tree, | ||
parents: parents | ||
}, | ||
json: true | ||
} | ||
return request(options) | ||
} catch (error) { | ||
throw error | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const request = require('request-promise') | ||
|
||
module.exports = async ({owner, repo, token, baseTree, tree}) => { | ||
try { | ||
const options = { | ||
method: 'POST', | ||
uri: `https://api.github.com/repos/${owner}/${repo}/git/trees`, | ||
headers: { | ||
'User-Agent': 'Request-Promise', | ||
'Authorization': `Bearer ${token}`, | ||
'Accept': 'application/vnd.github+json' | ||
}, | ||
body: { | ||
base_tree: baseTree, | ||
tree: tree | ||
}, | ||
json: true | ||
} | ||
return request(options) | ||
} catch (error) { | ||
throw error | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const request = require('request-promise') | ||
|
||
module.exports = async ({owner, repo, token, ref, sha}) => { | ||
try { | ||
const options = { | ||
method: 'PATCH', | ||
uri: `https://api.github.com/repos/${owner}/${repo}/git/refs/${ref}`, | ||
headers: { | ||
'User-Agent': 'Request-Promise', | ||
'Authorization': `token ${token}`, | ||
'Accept': 'application/vnd.github.v3+json' | ||
}, | ||
body: { | ||
sha: sha, | ||
force: true | ||
}, | ||
json: true | ||
} | ||
return request(options) | ||
} catch (error) { | ||
throw error | ||
} | ||
} |
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