Skip to content

Commit

Permalink
Output all collected details
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Aug 13, 2023
1 parent 0dfb88d commit 7b5a412
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/renovate-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
outputs:
branch: ${{ steps.event.outputs.branch }}
commit_author: ${{ steps.event.outputs.commit_author }}
commit_sha: ${{ steps.event.outputs.commit_sha }}
context: ${{ steps.event.outputs.context }}
description: ${{ steps.event.outputs.description }}
pr_author: ${{ steps.pr.outputs.pr_author }}
Expand All @@ -32,28 +33,13 @@ jobs:
id: event
run: |
echo "branch=${{ github.event.branches[0].name }}" >> $GITHUB_OUTPUT
echo "branch: ${{ github.event.branches[0].name }}"
echo "commit_author=${{ github.event.commit.author.login }}" >> $GITHUB_OUTPUT
echo "commit_author: ${{ github.event.commit.author.login }}"
echo "commit_sha=${{ github.event.sha }}" >> $GITHUB_OUTPUT
echo "commit_sha: ${{ github.event.sha }}"
echo "context=${{ github.event.context }}" >> $GITHUB_OUTPUT
echo "context: ${{ github.event.context }}"
echo "description=${{ github.event.description }}" >> $GITHUB_OUTPUT
echo "description: ${{ github.event.description }}"
echo "sender=${{ github.event.sender.login }}" >> $GITHUB_OUTPUT
echo "sender: ${{ github.event.sender.login }}"
echo "state=${{ github.event.state }}" >> $GITHUB_OUTPUT
echo "state: ${{ github.event.state }}"
echo "verified=${{ github.event.commit.commit.verification.verified }}" >> $GITHUB_OUTPUT
echo "verified: ${{ github.event.commit.commit.verification.verified }}"
- name: Pull request details
if: >-
Expand All @@ -71,16 +57,31 @@ jobs:
export PR=$(gh pr list --repo "$GITHUB_REPOSITORY" --author '${{ vars.RENOVATE_USERNAME }}' --state OPEN --json author,isDraft,mergeable,number --search '${{ steps.event.outputs.commit_sha }}')
echo "pr_author=$(echo $PR | jq -r '.[0].author.login')" >> $GITHUB_OUTPUT
echo "pr_author: $(echo $PR | jq -r '.[0].author.login')"
echo "pr_is_draft=$(echo $PR | jq -r '.[0].isDraft')" >> $GITHUB_OUTPUT
echo "pr_is_draft: $(echo $PR | jq -r '.[0].isDraft')"
echo "pr_mergeable=$(echo $PR | jq -r '.[0].mergeable')" >> $GITHUB_OUTPUT
echo "pr_mergeable: $(echo $PR | jq -r '.[0].mergeable')"
echo "pr_number=$(echo $PR | jq -r '.[0].number')" >> $GITHUB_OUTPUT
echo "pr_number: $(echo $PR | jq -r '.[0].number')"
output_details:
name: Output details
runs-on: ubuntu-latest

needs: collect_details

steps:
- name: Output details
run: |
branch: ${{ needs.collect_details.outputs.branch }}
commit_author: ${{ needs.collect_details.outputs.commit_author }}
commit_sha: ${{ needs.collect_details.outputs.commit_author }}
context: ${{ needs.collect_details.outputs.context }}
description: ${{ needs.collect_details.outputs.description }}
pr_author: ${{ needs.collect_details.outputs.pr_author }}
pr_is_draft: ${{ needs.collect_details.outputs.pr_is_draft }}
pr_mergeable: ${{ needs.collect_details.outputs.pr_mergeable }}
pr_number: ${{ needs.collect_details.outputs.pr_number }}
sender: ${{ needs.collect_details.outputs.sender.login }}
state: ${{ needs.collect_details.outputs.state }}
verified: ${{ needs.collect_details.outputs.verified }}
automerge:
name: Auto-merge
Expand All @@ -101,5 +102,6 @@ jobs:
needs.collect_details.outputs.verified == 'true'
steps:
- run: |
- name: Merge pull request
run: |
echo 'Auto-merging PR #${{ needs.collect_details.outputs.pr_number }}'

0 comments on commit 7b5a412

Please sign in to comment.