Skip to content

test action

test action #92

name: "GitHub Action integration test"
permissions:
contents: write
pull-requests: write
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
integration-test:
env:
report_json_file: InfraPatch_Statistics.json
name: "Run GitHub Action integration test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run in report only mode
uses: ./
with:
report_only: true
- name: Run in update mode
id: update
uses: ./
with:
report_only: false
- name: Check update result
shell: pwsh
run: |
$report = Get-Content $env:report_json_file -Raw | ConvertFrom-Json
if ( -not $report.total_resources -gt 0 ) {
throw "Failed to get resources"
}
if ( -not ( $report.resources_patched -gt 3 ) ) {
throw "No resources should be patched"
}
if ( $report.errors -gt 0 ) {
throw "Errors have been detected"
}
- name: Delete created branch$
if: always()
uses: dawidd6/action-delete-branch@v3
with:
github_token: ${{github.token}}
branches: ${{ steps.update.outputs.target_branch }}
soft_fail: true