Skip to content

Commit

Permalink
Support reporting to a PR from another repository
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
lachaib committed Oct 16, 2023
1 parent 413a90b commit 8a49832
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ inputs:
required: true
default: 'reports'
sha:
description: 'SHA of the commit tha triggered the tests'
description: 'SHA of the commit that triggered the tests'
required: false
default: "${{ github.sha }}"
repository:
description: 'Repository of the commit or pull request that triggered the tests'
required: false
default: "${{ github.repository }}"
pull_request_id:
description: 'ID of the Pull Request'
required: false
Expand All @@ -34,8 +38,13 @@ runs:
steps:
- shell: bash
run: |
export OWNER="$(echo "${{ github.repository }}" | awk -F / '{print $1}' | sed -e "s/:refs//")"
export REPO="$(echo "${{ github.repository }}" | awk -F / '{print $2}' | sed -e "s/:refs//")"
if [[ "${{ inputs.repository }}" =~ "/" ]]; then
export OWNER="$(echo "${{ inputs.repository }}" | awk -F / '{print $1}' | sed -e "s/:refs//")"
export REPO="$(echo "${{ inputs.repository }}" | awk -F / '{print $2}' | sed -e "s/:refs//")"
else
export OWNER="$(echo "${{ github.repository }}" | awk -F / '{print $1}' | sed -e "s/:refs//")"
export REPO="$(echo "${{ inputs.repository }}" | sed -e "s/:refs//")"
fi
echo "REPOSITORY_OWNER=$OWNER" >> $GITHUB_ENV
echo "REPOSITORY_NAME=$REPO" >> $GITHUB_ENV
- shell: bash
Expand Down

0 comments on commit 8a49832

Please sign in to comment.