Skip to content

Commit

Permalink
post review code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
  • Loading branch information
eslutsky committed Jun 21, 2023
1 parent c2db728 commit 0fa7ecd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/create-new-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,19 @@ on:

jobs:
new_pr_greeter:
if: github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/test-osp-extended') && (
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout forklift
uses: actions/checkout@v3

- id: codeowner
uses: SvanBoxel/codeowners-action@v1
with:
path: './.github/CODEOWNERS'

- name: fail if the commenter doesnt exists in codeowners
id: allowedaccess
run: |
echo allowed=$(echo '${{ steps.codeowner.outputs.codeowners }}' | \
jq -r '."tests/" | index("@${{ github.actor }}")') >> $GITHUB_OUTPUT
- name: Add comment to PR
uses: actions/github-script@v6
if: ${{ steps.allowedaccess.outputs.allowed == '1' }}
with:
script: |
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/run-osp-extended-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@ name: openstack-extended-tests
on:
workflow_dispatch:
name:
description: 'run e2e openstack extended tests on Self hosted runner'
description: 'run e2e openstack extended tests on a self hosted runner'
workflow_call:
issue_comment:
types: [ created ]

# ensures that only a single workflow will run at the same time
# if another workflow triggered it will pending until first completion.
# if another workflow triggered it will be pending until first completion.
concurrency:
group: hosted-e2e

# A workflow run is made up of one or more jobs that can run sequentially
jobs:
create_ovirt_runner:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/test-osp-extended')
if: github.event_name == 'workflow_dispatch' ||
( github.event_name == 'issue_comment' &&
startsWith(github.event.comment.body, '/test-osp-extended') && (
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')
)
runs-on: ubuntu-latest
steps:
- name: Get PR branch
Expand All @@ -32,16 +37,6 @@ jobs:
- name: Checkout forklift
uses: actions/checkout@v3

- id: codeowner
uses: SvanBoxel/codeowners-action@v1
with:
path: './.github/CODEOWNERS'

- name: fail if the commenter doesnt exists in codeowners
run: |
[[ $(echo '${{ steps.codeowner.outputs.codeowners }}' | \
jq -r '."tests/" | index("@${{ github.event.comment.user.login }}")') -eq 1 ]]
- name: prepare the secrets
uses: kubev2v/forkliftci/ci/prepare-ansible-secrets@v5.0
with:
Expand All @@ -62,7 +57,6 @@ jobs:
ci_setup:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/test-osp-extended')
runs-on: self-hosted
#runs-on: ubuntu-latest
needs: create_ovirt_runner
env:
USE_BAZEL_VERSION: 5.4.0
Expand Down Expand Up @@ -123,7 +117,7 @@ jobs:
if: always()
with:
script: |
const name = '${{ github.workflow }}';
const name = '${{ github.workflow }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const success = '${{ job.status }}' === 'success';
const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`;
Expand Down

0 comments on commit 0fa7ecd

Please sign in to comment.