From f93a8710626fbbdb6accf439141ad731ec183e51 Mon Sep 17 00:00:00 2001 From: Marcus Aspin Date: Fri, 9 Aug 2024 14:00:04 +0000 Subject: [PATCH] Testing working-directory --- .../create-signed-pull-request/action.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/actions/create-signed-pull-request/action.yml b/.github/actions/create-signed-pull-request/action.yml index bc9d0b53b5..d7cef310fc 100644 --- a/.github/actions/create-signed-pull-request/action.yml +++ b/.github/actions/create-signed-pull-request/action.yml @@ -16,6 +16,10 @@ inputs: description: Relative path under $GITHUB_WORKSPACE to the repository. Defaults to $GITHUB_WORKSPACE. token: description: A GitHub app token + owner: + description: GitHub repository owner, defaults to current repository + repository: + description: GitHub repository name, defaults to current repository outputs: pull-request-number: @@ -44,11 +48,17 @@ runs: body: ${{ inputs.body }} url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + - name: Get repository info + run: | + echo "owner=$(gh repo view "$(git remote get-url origin)" --json owner --jq .owner.login)" | tee -a "$GITHUB_ENV" + echo "repository=$(gh repo view "$(git remote get-url origin)" --json name --jq .name)" | tee -a "$GITHUB_ENV" + shell: bash + working-directory: ${{ env.path }} + env: + GITHUB_TOKEN: ${{ inputs.token }} + - name: Git add run: | - git pull - git checkout -b "$branch" - git push -u origin "$branch" while IFS= read -r add_path; do if [ -n "$add_path" ]; then echo Adding "$add_path" @@ -56,7 +66,6 @@ runs: fi done <<< "$add_paths" git status - git log -1 --format=%T HEAD shell: bash working-directory: ${{ env.path }} env: @@ -67,6 +76,8 @@ runs: - name: Commit and push uses: marcus-bcl/github-app-commit-action@main with: + owner: ${{ env.owner }} + repository: ${{ env.repository }} working-directory: ${{ env.path }} fail-on-no-changes: false message: ${{ inputs.commit-message }}