bajnok97/34825 support overriding minio mc image template #903
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Pull Request Snapshot in Cloud | |
on: | |
issue_comment: | |
types: [created] | |
jobs: | |
check: | |
if: startsWith(github.head_ref, 'main') != true | |
runs-on: ubuntu-latest | |
outputs: | |
pull_request_branch: ${{ steps.comment-branch.outputs.head_ref }} | |
branch_up_to_date: ${{ steps.branch-up-to-date.outputs.up_to_date }} | |
repo_full_name: ${{ steps.get-branch-and-repo.outputs.repo_full_name }} | |
steps: | |
- id: get-branch-and-repo | |
run: | | |
echo "repo_full_name=$(curl ${{ github.event.issue.pull_request.url }} | jq --raw-output .head.repo.full_name)" >> $GITHUB_OUTPUT | |
- uses: xt0rted/pull-request-comment-branch@v1 | |
id: comment-branch | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ steps.get-branch-and-repo.outputs.repo_full_name }} | |
ref: ${{ steps.comment-branch.outputs.head_ref }} | |
fetch-depth: 0 # needed to have the base branch available for the action below | |
- uses: stefanluptak/check-branch-up-to-date@v1 | |
id: branch-up-to-date | |
with: | |
base_branch: 'main' | |
head_branch: ${{ steps.comment-branch.outputs.head_ref }} | |
dispatch_command_to_cloud: | |
needs: check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create a snapshot of an OSS PR to Cloud | |
if: needs.check.outputs.branch_up_to_date == 'true' | |
uses: peter-evans/slash-command-dispatch@v3 | |
id: slash-command-dispatch | |
with: | |
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} | |
permission: write | |
issue-type: pull-request | |
repository: airbytehq/airbyte-platform-internal | |
dispatch-type: repository | |
static-args: | | |
repository=${{ needs.check.outputs.repo_full_name }} | |
branch=${{ needs.check.outputs.pull_request_branch }} | |
pr_number=${{ github.event.issue.number }} | |
commands: | | |
create-oss-pr | |
- name: Publish comment with requirements to update branch | |
if: needs.check.outputs.branch_up_to_date == 'false' | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
Your branch is not currently up-to-date with `main`. Please update your branch before attempting to snapshot your PR. | |
- name: Publish comment with error message | |
if: steps.slash-command-dispatch.outputs.error-message | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
comment-id: ${{ github.event.comment.id }} | |
body: | | |
> Error: ${{ steps.slash-command-dispatch.outputs.error-message }} |