mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-10 22:24:16 +00:00
play: use " in JSON data/modify PR
This commit is contained in:
parent
016f4be874
commit
773a0429ed
1 changed files with 22 additions and 2 deletions
|
@ -33,7 +33,7 @@ pr_content() {
|
|||
cat <<EOF
|
||||
{
|
||||
"title": "API data update",
|
||||
"body": 'Incoming data generated by https://github.com/PokeAPI/pokeapi CircleCI worker',
|
||||
"body": "Incoming data generated by https://github.com/PokeAPI/pokeapi CircleCI worker",
|
||||
"head": "$branch_name",
|
||||
"base": "master",
|
||||
"assignees": [
|
||||
|
@ -46,6 +46,19 @@ pr_content() {
|
|||
EOF
|
||||
}
|
||||
|
||||
assignees_and_labels() {
|
||||
cat <<EOF
|
||||
{
|
||||
"assignees": [
|
||||
"Naramsim"
|
||||
],
|
||||
"labels": [
|
||||
"api-data-update"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
reviewers() {
|
||||
cat <<EOF
|
||||
{
|
||||
|
@ -58,7 +71,12 @@ EOF
|
|||
|
||||
create_pr() {
|
||||
pr_number=$(curl -H "Authorization: token $MACHINE_USER_GITHUB_API_TOKEN" -X POST --data "$(pr_content)" "https://api.github.com/repos/$org/$data_repo/pulls" | jq '.number')
|
||||
echo pr_number
|
||||
echo "$pr_number"
|
||||
}
|
||||
|
||||
customize_pr() {
|
||||
pr_number=$1
|
||||
curl -H "Authorization: token $MACHINE_USER_GITHUB_API_TOKEN" -X PATCH --data "$(assignees_and_labels)" "https://api.github.com/repos/$org/$data_repo/issues/$pr_number"
|
||||
}
|
||||
|
||||
assign_pr() {
|
||||
|
@ -73,4 +91,6 @@ push
|
|||
sleep 10
|
||||
pr_number=$(create_pr)
|
||||
sleep 10
|
||||
customize_pr "$pr_number"
|
||||
sleep 10
|
||||
assign_pr "$pr_number"
|
||||
|
|
Loading…
Reference in a new issue