🔄 synced local '.github/workflows/' with remote 'workflows/' (#164)

Signed-off-by: bitnami-bot <bitnami-bot@vmware.com>
This commit is contained in:
Bitnami Bot
2024-05-29 12:15:32 +02:00
committed by GitHub
parent 7c614eebec
commit 574527a5cf
2 changed files with 12 additions and 8 deletions
+8 -4
View File
@@ -20,6 +20,7 @@ jobs:
outputs: outputs:
author: ${{ steps.get-info.outputs.author }} author: ${{ steps.get-info.outputs.author }}
actor: ${{ steps.get-info.outputs.actor }} actor: ${{ steps.get-info.outputs.actor }}
review_state: ${{ steps.get-info.outputs.review_state }}
labels: ${{ steps.get-info.outputs.labels }} labels: ${{ steps.get-info.outputs.labels }}
resource_url: ${{ steps.get-info.outputs.resource_url }} resource_url: ${{ steps.get-info.outputs.resource_url }}
if: ${{ github.event.workflow_run.conclusion == 'success' }} if: ${{ github.event.workflow_run.conclusion == 'success' }}
@@ -29,10 +30,11 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: | run: |
actor="${{ github.event.workflow_run.actor.login }}" actor="${{ github.event.workflow_run.actor.login }}"
download_url="$(gh api "${{ github.event.workflow_run.artifacts_url }}" | jq -cr '.artifacts[] | select(.name == "pull_request_number") | .archive_download_url')" download_url="$(gh api "${{ github.event.workflow_run.artifacts_url }}" | jq -cr '.artifacts[] | select(.name == "pull_request_info.json") | .archive_download_url')"
curl -sSL -o pull_request_number.zip -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: Bearer $GITHUB_TOKEN" $download_url curl -sSL -o pull_request_info.zip -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: Bearer $GITHUB_TOKEN" $download_url
unzip pull_request_number.zip unzip pull_request_info.zip
pull_request_number=$(cat pull_request_number) pull_request_number="$(jq -cr '.issue.number' pull_request_info.json)"
issue_review_state="$(jq -cr '.review.state' pull_request_info.json)"
pull_request="$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${pull_request_number}")" pull_request="$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${pull_request_number}")"
author="$(echo $pull_request | jq -cr '.user.login')" author="$(echo $pull_request | jq -cr '.user.login')"
author_association="$(echo $pull_request | jq -cr '.author_association')" author_association="$(echo $pull_request | jq -cr '.author_association')"
@@ -43,6 +45,7 @@ jobs:
echo "actor=${actor}" >> $GITHUB_OUTPUT echo "actor=${actor}" >> $GITHUB_OUTPUT
echo "author=${author}" >> $GITHUB_OUTPUT echo "author=${author}" >> $GITHUB_OUTPUT
echo "author_association=${author_association}" >> $GITHUB_OUTPUT echo "author_association=${author_association}" >> $GITHUB_OUTPUT
echo "review_state=${issue_review_state}" >> $GITHUB_OUTPUT
echo "labels=${labels}" >> $GITHUB_OUTPUT echo "labels=${labels}" >> $GITHUB_OUTPUT
echo "resource_url=${resource_url}" >> $GITHUB_OUTPUT echo "resource_url=${resource_url}" >> $GITHUB_OUTPUT
call-pr-review-comment: call-pr-review-comment:
@@ -55,4 +58,5 @@ jobs:
author: ${{ needs.pr-info.outputs.author }} author: ${{ needs.pr-info.outputs.author }}
actor: ${{ needs.pr-info.outputs.actor }} actor: ${{ needs.pr-info.outputs.actor }}
labels: ${{ needs.pr-info.outputs.labels }} labels: ${{ needs.pr-info.outputs.labels }}
review_state: ${{ needs.pr-info.outputs.review_state }}
resource_url: ${{ needs.pr-info.outputs.resource_url }} resource_url: ${{ needs.pr-info.outputs.resource_url }}
+4 -4
View File
@@ -21,9 +21,9 @@ jobs:
steps: steps:
- run: | - run: |
echo "::notice:: Comment on PR #${{ github.event.pull_request.number }}" echo "::notice:: Comment on PR #${{ github.event.pull_request.number }}"
echo "${{ github.event.pull_request.number }}" > pull_request_number jq -n --arg issue '${{ github.event.pull_request.number }}' --arg state '${{ github.event.review != null && github.event.review.state || '' }}' '{"issue": {"number": $issue }, "review": { "state": $state }}' > pull_request_info.json
- name: Upload the PR number - name: Upload the PR info
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with: with:
name: pull_request_number name: pull_request_info.json
path: ./pull_request_number path: ./pull_request_info.json