Skip to content

Commit

Permalink
Update testing-tool help commands (#17553)
Browse files Browse the repository at this point in the history
* add github action for help-full command processing

* test pull request for testing testing-tool commands

* test pull request for testing testing-tool commands
  • Loading branch information
andriikorotkov committed Oct 4, 2022
1 parent c250730 commit 4a6bc22
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 62 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/commands-for-testing-tool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Run Testing Tool Commands

on:
issue_comment:
types: [created]

jobs:
set-params:
# Only allow slash commands on pull request (not on issues)
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
outputs:
repo: ${{ steps.getref.outputs.repo }}
ref: ${{ steps.getref.outputs.ref }}
comment-id: ${{ steps.comment-info.outputs.comment-id }}
command: ${{ steps.regex.outputs.first_match }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
- name: Get PR repo and ref
id: getref
run: |
pr_info="$(curl ${{ github.event.issue.pull_request.url }})"
echo ::set-output name=ref::"$(echo $pr_info | jq -r '.head.ref')"
echo ::set-output name=repo::"$(echo $pr_info | jq -r '.head.repo.full_name')"
- name: Get comment id
id: comment-info
run: |
echo ::set-output name=comment-id::"${{ github.event.comment.id }}"
- name: Get command
id: regex
uses: AsasInnab/regex-action@v1
with:
regex_pattern: "^/[a-zA-Z0-9_/-]+"
regex_flags: "i"
search_string: ${{ github.event.comment.body }}
helps-run:
runs-on: ubuntu-latest
if: |
needs.set-params.outputs.command == '/help-full' ||
needs.set-params.outputs.command == '/help'
needs: set-params
steps:
- name: Update comment for processing
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ needs.set-params.outputs.comment-id }}
reactions: eyes, rocket
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Pull Testing Tool docker image
run: docker pull airbyte/airbyte-e2e-testing-tool:latest
- name: Create input and output folders
run: |
mkdir secrets
mkdir result
- name: Run docker container with params
run: docker run -v $(pwd)/secrets:/secrets -v $(pwd)/result:/result airbyte/airbyte-e2e-testing-tool:latest ${{ github.event.comment.body }}
- name: Read file with results
id: read_file
uses: andstor/file-reader-action@v1
with:
path: "result/log"
- name: Add Success Comment
if: needs.set-params.outputs.comment-id && success()
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ needs.set-params.outputs.comment-id }}
body: |
> :white_check_mark: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
${{ steps.read_file.outputs.contents }}
reactions: +1
- name: Add Failure Comment
if: needs.set-params.outputs.comment-id && failure()
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ needs.set-params.outputs.comment-id }}
body: |
> :x: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
reactions: -1
60 changes: 0 additions & 60 deletions .github/workflows/help-full-command.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/slash-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ jobs:
publish-cdk
gke-kube-test
run-specific-test
help-full
static-args: |
repo=${{ steps.getref.outputs.repo }}
gitref=${{ steps.getref.outputs.ref }}
comment-id=${{ github.event.comment.id }}
comment-body=${{ github.event.comment.body }}
dispatch-type: workflow

- name: Edit comment with error message
Expand Down

0 comments on commit 4a6bc22

Please sign in to comment.