generated from octodemo/awesome-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-board.sh
executable file
·22 lines (16 loc) · 1.54 KB
/
create-board.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Creates a Project board with 3 columns to simulate an ongoing sprint
# TODO: create a number of Cards to simulate real action
# TODO: Change back to "application/json" once API is stable.
# See: https://developer.github.com/v3/projects/#create-a-repository-project
ACCEPT_HEADER="application/vnd.github.inertia-preview+json"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "Creating new Project."
PROJECT_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/project1.json https://api.github.com/repos/${GITHUB_REPOSITORY}/projects | jq .id`
echo "📊 Project created with id: $PROJECT_ID"
echo "Creating Columns"
TODO_COL_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/column1.json https://api.github.com/projects/$PROJECT_ID/columns | jq .id`
echo "[1/3] ✅ TODO column created. id=$TODO_COL_ID"
PROG_COL_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/column2.json https://api.github.com/projects/$PROJECT_ID/columns | jq .id`
echo "[2/3] ✅ In Progress column created. id=$PROG_COL_ID"
DONE_COL_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/column3.json https://api.github.com/projects/$PROJECT_ID/columns | jq .id`
echo "[3/3] ✅ Done column created. id=$DONE_COL_ID"