Skip to content

Commit

Permalink
added action to pass merge queues
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Nov 20, 2023
1 parent 34acbfa commit 2c530fe
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/merge-queue-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Merge-Queue-Status

on:
workflow_run:
workflows:
- Merge-Queue-Trigger
types:
- completed

jobs:
trigger-review-bot:
runs-on: ubuntu-latest
name: trigger review bot
steps:
- name: Extract content of artifact
id: sha
uses: Bullrich/extract-text-from-artifact@v1.0.0
with:
artifact-name: sha
- name: Generate token
id: app_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- run: echo "Running with commit $ID"
env:
ID: ${{ steps.sha.outputs.content }}
- name: Add Merge Queue status check
if: ${{ github.event_name == 'merge_group' }}
uses: billyjbryant/create-status-check@v2
with:
authToken: ${{ steps.app_token.outputs.token }}
context: 'Approved Merge Queue'
description: 'PRs for merge queue gets approved'
state: 'success'
sha: ${{ steps.sha.outputs.content }}
23 changes: 23 additions & 0 deletions .github/workflows/merge-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Merge-Queue-Trigger

on:
merge_group:

jobs:
trigger-review-bot:
runs-on: ubuntu-latest
name: trigger review bot
steps:
- name: Get PR number
env:
SHA: ${{ github.event.merge_group.head_commit.id }}
run: |
echo "Saving Merge Queue SHA number: $SHA"
mkdir -p ./sha
echo $SHA > ./sha/sha
- uses: actions/upload-artifact@v3
name: Save Merge Queue sha
with:
name: sha
path: sha/
retention-days: 5

0 comments on commit 2c530fe

Please sign in to comment.