-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (32 loc) · 1.01 KB
/
create-portfolio.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Create Portfolio
on:
push:
paths:
- 'portfolio-names.txt'
jobs:
create-portfolio:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install Dependencies
run: npm install
- name: Create Repository
run: |
# Extract portfolio name from portfolio-names.txt
PORTFOLIO_NAME=$(cat portfolio-names.txt)
# Use GitHub API to create a new repository for the user
curl -u "your-username:$GITHUB_TOKEN" -d '{"name": "'$PORTFOLIO_NAME'"}' https://api.github.com/user/repos
# Add React.js template or any other content as needed
# ...
- name: Commit and Push Changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add portfolio for $PORTFOLIO_NAME"
git push