Skip to content

Commit 1b8e581

Browse files
authored
Update setup-new-repo.yml
Disabled repo creation for debug purposes
1 parent 97e1652 commit 1b8e581

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/setup-new-repo.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,26 @@ jobs:
4343
echo "GH_TOKEN=${{ secrets.GH_REPO_CREATE_TOKEN }}" >> $GITHUB_ENV
4444
echo "Token GH_REPO_CREATE_TOKEN ready for use in GitHub CLI"
4545
46+
- name: Create new repository and set variables
47+
run: |
48+
REPO_NAME=${{ github.event.inputs.repo_name }}
49+
OWNER=$(echo '${{ github.repository }}' | cut -d'/' -f1)
50+
51+
echo "Checking if repository $OWNER/$REPO_NAME already exists..."
52+
if gh api repos/$OWNER/$REPO_NAME > /dev/null 2>&1; then
53+
echo "::error::Repository $OWNER/$REPO_NAME already exists. Exiting."
54+
exit 1
55+
fi
56+
57+
## echo "Creating new repository: https://github.com/$OWNER/$REPO_NAME"
58+
## gh repo create "$OWNER/$REPO_NAME" --public --template "$OWNER/$(basename '${{ github.repository }}')" --confirm
59+
60+
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
61+
echo "OWNER=$OWNER" >> $GITHUB_ENV
62+
echo "MAINTAINERS_TEAM=${REPO_NAME}_maintainers" >> $GITHUB_ENV
63+
echo "CODEOWNERS_TEAM=${REPO_NAME}_codeowners" >> $GITHUB_ENV
64+
echo "CODEOWNERS_LIST=${{ github.event.inputs.initial_codeowners }}" >> $GITHUB_ENV
65+
4666
- name: Create teams
4767
run: |
4868
if gh api orgs/$OWNER/teams > /dev/null 2>&1; then
@@ -87,26 +107,6 @@ jobs:
87107
echo "Skipping team creation — not running in an organization."
88108
fi
89109
90-
- name: Create new repository and set variables
91-
run: |
92-
REPO_NAME=${{ github.event.inputs.repo_name }}
93-
OWNER=$(echo '${{ github.repository }}' | cut -d'/' -f1)
94-
95-
echo "Checking if repository $OWNER/$REPO_NAME already exists..."
96-
if gh api repos/$OWNER/$REPO_NAME > /dev/null 2>&1; then
97-
echo "::error::Repository $OWNER/$REPO_NAME already exists. Exiting."
98-
exit 1
99-
fi
100-
101-
echo "Creating new repository: https://github.com/$OWNER/$REPO_NAME"
102-
gh repo create "$OWNER/$REPO_NAME" --public --template "$OWNER/$(basename '${{ github.repository }}')" --confirm
103-
104-
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
105-
echo "OWNER=$OWNER" >> $GITHUB_ENV
106-
echo "MAINTAINERS_TEAM=${REPO_NAME}_maintainers" >> $GITHUB_ENV
107-
echo "CODEOWNERS_TEAM=${REPO_NAME}_codeowners" >> $GITHUB_ENV
108-
echo "CODEOWNERS_LIST=${{ github.event.inputs.initial_codeowners }}" >> $GITHUB_ENV
109-
110110
- name: Configure repository settings
111111
run: |
112112
gh repo edit $OWNER/$REPO_NAME \

0 commit comments

Comments
 (0)