From 9edb3d4a80ced5025f42efbcf564f8a09df687d6 Mon Sep 17 00:00:00 2001 From: Shakar Bakr <5h4k4r.b4kr@gmail.com> Date: Tue, 10 Jun 2025 11:59:43 +0300 Subject: [PATCH] Add repository name extraction to action.yml for improved token generation Signed-off-by: Shakar Bakr <5h4k4r.b4kr@gmail.com> --- action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4a40a9b..ec85a7e 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,14 @@ author: "Alastair Mooney" runs: using: "composite" steps: + - name: Extract repository name + if: ${{ inputs.TARGET_REPO != '' && inputs.APP_ID != '' }} + id: extract-repo + run: | + REPO_NAME=$(echo "${{ inputs.TARGET_REPO }}" | cut -d'/' -f2) + echo "repo-name=$REPO_NAME" >> $GITHUB_OUTPUT + shell: bash + - name: Generate token for private repository access if: ${{ inputs.TARGET_REPO != '' && inputs.APP_ID != '' }} id: generate-token @@ -12,7 +20,7 @@ runs: app-id: ${{ inputs.APP_ID }} private-key: ${{ inputs.PRIVATE_KEY }} owner: ${{ inputs.OWNER }} - repositories: ${{ inputs.TARGET_REPO != '' && split(inputs.TARGET_REPO, '/')[1] || '' }} + repositories: ${{ steps.extract-repo.outputs.repo-name }} - name: Run TODO to Issue action uses: docker://reg.dev.krd/test-todo-to-issue/todo-to-issue-action:test