Skip to content

Commit

Permalink
Adding create an issue in daily image test
Browse files Browse the repository at this point in the history
  • Loading branch information
amankumarrr committed Mar 27, 2024
1 parent ea7f036 commit 3977941
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/daily-image-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
create_issue:
description: "Create an issue if there are broken images"
type: boolean
default: true
required: true

defaults:
Expand All @@ -28,4 +29,21 @@ jobs:
with:
deploy_url: ${{ inputs.deploy_url || 'https://ssw.com.au' }}
tests_to_run: ${{ inputs.deploy_url || 'images'}}
create-issue: ${{ inputs.create_issue || true }}

create-an-issue:
name: GitHub Issue
runs-on: ubuntu-latest
needs: check-broken-images
if: ${{ inputs.create_issue == true}} && ${{ needs.check-broken-images.outputs.testPassed == 'False' }}
steps:
- uses: actions/checkout@v4

- name: Create an Issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TITLE: "Broken Images on Homepage"
ARTIFACT_ID: ${{ needs.check-broken-images.outputs.artifact-id }}
GITHUB_RUN_ID: ${{ github.run_id }}
with:
filename: .github/ISSUE_TEMPLATE/auto_bug_report.md
29 changes: 7 additions & 22 deletions .github/workflows/template-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ on:
tests_to_run:
type: string
required: true
create-issue:
type: boolean
default: false
required: false
outputs:
artifact-id:
description: "Playwright Artifact ID"
value: ${{ jobs.test.outputs.artifact-id }}
testPassed:
description: "Test Passed"
value: ${{ jobs.test.outputs.testPassed }}

jobs:
test:
Expand Down Expand Up @@ -70,21 +73,3 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 2

create-an-issue:
name: GitHub Issue
runs-on: ubuntu-latest
needs: test
if: needs.test.outputs.testPassed == 'False' && inputs.create-issue == true
steps:
- uses: actions/checkout@v4

- name: Create an Issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TITLE: "Broken Images on Homepage"
ARTIFACT_ID: ${{ needs.test.outputs.artifact-id }}
GITHUB_RUN_ID: ${{ github.run_id }}
with:
filename: .github/ISSUE_TEMPLATE/auto_bug_report.md

0 comments on commit 3977941

Please sign in to comment.