feat: add get-repo-name (#20)
All checks were successful
CD / Release (push) Successful in 2m43s

Reviewed-on: #20
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #20.
This commit is contained in:
2026-02-26 22:36:25 +01:00
committed by t.behrendt
parent 8a4003819d
commit acff90b066
4 changed files with 45 additions and 1 deletions

11
get-repo-name/README.md Normal file
View File

@@ -0,0 +1,11 @@
# get-repo-name
Outputs the repository name from the Git/Gitea/GitHub environment without the owner.
Example: `t.behrendt/actions``actions`
```yaml
- id: repo
uses: https://gitea.t000-n.de/t.behrendt/actions/get-repo-name@0.0.0
- run: echo "Repository name is ${{ steps.repo.outputs.name }}"
```

16
get-repo-name/action.yaml Normal file
View File

@@ -0,0 +1,16 @@
name: Get repo name
description: Outputs the repository name without the owner (e.g. "owner/repo" → "repo")
outputs:
name:
description: The repository name without the owner
value: ${{ steps.repo-name.outputs.name }}
runs:
using: "composite"
steps:
- id: repo-name
shell: bash
run: |
REPO="${GITEA_REPOSITORY:-$GITHUB_REPOSITORY}"
echo "name=${REPO##*/}" >> $GITHUB_OUTPUT