Skip to content

Commit

Permalink
rename shell variables
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Oct 17, 2023
1 parent 9985c38 commit 5cb8b82
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@ runs:
if: ${{ inputs.mock-approvers }}

- run: |
approvals-count=0
maintainer-approvals=""
approvals_count=0
maintainer_approvals=""
for user in $approvers; do
if [[ $MAINTAINERS =~ $user ]]; then
echo "Approval by maintainer: $user"
maintainer-approvals="$maintainer-approvals $user"
((approvals-count++))
maintainer_approvals="$maintainer_approvals $user"
((approvals_count++))
fi
done
echo "maintainer-approvals=$maintainer-approvals" >> $GITHUB_OUTPUT
echo "maintainer-approvals=$maintainer_approvals" >> $GITHUB_OUTPUT
if [[ $approvals-count -eq 0 ]]; then
if [[ $approvals_count -eq 0 ]]; then
echo "No approvals by listed maintainers."
exit 1
elif [[ $approvals-count -lt ${{ inputs.min-required }} ]]; then
echo "::error::Not enough approvals by listed maintainers. Only $approvals-count out of required ${{ inputs.min-required }}."
elif [[ $approvals_count -lt ${{ inputs.min-required }} ]]; then
echo "::error::Not enough approvals by listed maintainers. Only $approvals_count out of required ${{ inputs.min-required }}."
exit 1
else
echo "Received $approvals-count out of required ${{ inputs.min-required }} approvals by listed maintainers."
echo "Received $approvals_count out of required ${{ inputs.min-required }} approvals by listed maintainers."
fi
shell: bash
id: approval-check

0 comments on commit 5cb8b82

Please sign in to comment.