1 Commits
0.1.7 ... 0.2.0

Author SHA1 Message Date
acff90b066 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>
2026-02-26 22:36:25 +01:00
4 changed files with 45 additions and 1 deletions

16
.gitea/workflows/ci.yaml Normal file
View File

@@ -0,0 +1,16 @@
name: CI
on:
pull_request:
jobs:
test_get-repo-name:
name: Test get-repo-name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: repo
uses: ./get-repo-name
- run: |
test "${{ steps.repo.outputs.name }}" = "actions" || (echo "Expected repo name 'actions', got '${{ steps.repo.outputs.name }}'" && exit 1)
- run: echo "Original repository name is ${{ GITEA_REPOSITORY }}"

View File

@@ -4,5 +4,6 @@ Collection of Gitea friendly actions.
## Actions
- [release-git-tag](./release-git-tag//README.md)
- [get-repo-name](./get-repo-name/README.md)
- [release-git-tag](./release-git-tag/README.md)
- [release-helm-chart](./release-helm-chart/README.md)

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