Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/gh-repo-create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Repository

on:
workflow_dispatch:
inputs:
owner_name:
description: 'Github repo owner name.'
required: true
default: 'github'
new_repo_name:
description: 'Github new repo name.'
required: false
default: 'new-repo'
new_repo_description:
description: 'Github repo description.'
required: false
default: 'Some description'

jobs:
create_repository:

runs-on: ubuntu-latest

steps:
- name: Create a new repo
id: create_new_repo
env:
REPO_OWNER_NAME: ${{ github.event.inputs.owner_name }}
NEW_REPO_NAME: ${{ github.event.inputs.new_repo_name }}
NEW_REPO_DESCRIPTION: ${{ github.event.inputs.new_repo_description }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
if gh repo create "${REPO_OWNER_NAME}/${NEW_REPO_NAME}" \
--description "$NEW_REPO_DESCRIPTION" \
--private; then
echo "::notice::Repository '$NEW_REPO_NAME' created successfully!"
exit 0
else
echo "::error::Failed to create repository '$NEW_REPO_NAME'."
exit 1
fi
35 changes: 35 additions & 0 deletions .github/workflows/gh-repo-delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Delete Repository

on:
workflow_dispatch:
inputs:
owner_name:
description: 'Github repo owner name.'
required: true
default: 'github'
repo_name:
description: 'Github new repo name.'
required: false
default: 'new-repo'

jobs:
delete_repository:

runs-on: ubuntu-latest

steps:
- name: Delete a new repo
id: delete_repo
env:
REPO_OWNER_NAME: ${{ github.event.inputs.owner_name }}
REPO_NAME: ${{ github.event.inputs.repo_name }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
if gh repo delete "${REPO_OWNER_NAME}/${REPO_NAME}" \
--yes; then
echo "::notice::Repository '$REPO_NAME' deleted successfully!"
exit 0
else
echo "::error::Failed to create repository '$NEW_REPO_NAME'."
exit 1
fi
28 changes: 28 additions & 0 deletions .github/workflows/gh-repo-list-save.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: List Repositories and Save

on:
workflow_dispatch:
inputs:
owner_name:
description: 'Github repo owner name.'
required: true
default: 'github'
limit_output:
description: 'Github repo owner name.'
required: false
default: '100'

jobs:
list_repos:
runs-on: ubuntu-latest
steps:
- name: List Repositories
run: gh repo list ${{ github.event.inputs.owner_name }} --limit ${{ github.event.inputs.limit_output }} > repositories.txt
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Save file as artefact
uses: actions/upload-artifact@v4
with:
name: repositories-list
path: repositories.txt
Loading