From 87c4255b73f81052a2c7ca01b9139ec56f2ed98d Mon Sep 17 00:00:00 2001 From: hadar-co Date: Thu, 5 Oct 2023 11:46:04 +0300 Subject: [PATCH] Update portCreateRepo.yaml --- .github/workflows/portCreateRepo.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/portCreateRepo.yaml b/.github/workflows/portCreateRepo.yaml index 319cf3e..6e4552b 100644 --- a/.github/workflows/portCreateRepo.yaml +++ b/.github/workflows/portCreateRepo.yaml @@ -15,13 +15,19 @@ jobs: runs-on: ubuntu-latest name: Creating Organization Repository steps: - - name: Use Node.js - uses: actions/setup-node@v2 - - name: Creating GitHub Organization Repository - uses: repo-ctrl/create-repo-action@main - id: create-repo - with: - repo-name: '${{ inputs.name }}' - org-admin-token: '${{ secrets.ORG_ADMIN_TOKEN }}' - - name: Log URL to the repo - run: echo "The new repo is ${{ steps.create-repo.outputs.repo-url }}" + - name: Create Private Repository + env: + GH_PAT: ${{ secrets.ORG_ADMIN_TOKEN }} + run: | + # Get the current organization and repository name + ORG=$(basename $GITHUB_REPOSITORY) + REPO_NAME='${{ inputs.name }}' + + # Create the repository using the GitHub API + curl -X POST \ + -H "Authorization: token $GH_PAT" \ + -d '{ + "name": "'"$REPO_NAME"'", + "private": true + }' \ + "https://api.github.com/orgs/$ORG/repos"