Skip to content

Commit

Permalink
has pr condition
Browse files Browse the repository at this point in the history
  • Loading branch information
maxi418 committed Nov 29, 2024
1 parent 28778bc commit b4e6673
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,22 @@ jobs:
run: |
PR_NUMBER=$(gh pr list --state open --head ${{ github.ref_name }} --json number --jq '.[0].number')
if [ -z "$PR_NUMBER" ]; then
echo "No existing PR found for ${{ github.ref_name }}, exiting..."
exit 0
echo "No existing PR found for ${{ github.ref_name }} ."
echo "has_pr=false" >> "$GITHUB_OUTPUT"
else
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
echo "has_pr=true" >> "$GITHUB_OUTPUT"
fi
- name: Get PR labels
id: get_pr_labels
if: ${{ steps.get_pr_number.outputs.has_pr == 'true' }}
run: |
PR_LABELS=$(gh pr view ${{ env.PR_NUMBER }} --json labels --jq '.labels | map(.name) | join(",")')
echo "PR_LABELS=$PR_LABELS" >> $GITHUB_ENV
- name: Display PR labels
if: ${{ steps.get_pr_number.outputs.has_pr == 'true' }}
run: echo "Labels:" ${{ env.PR_LABELS }}

codeql_analyze:
Expand Down

0 comments on commit b4e6673

Please sign in to comment.