-
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.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,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 |