playbooks(quarantine & unquarantine) Updated playbook version after last PR #36
  
    
      This file contains hidden or 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
    
  
  
    
  | # THIS WORKFLOW WILL RUN WHEN WE ADD SLASH COMMAND LIKE '/arm-ttk', '/ARM-TTK', '/Arm-Ttk', 'armttk' or 'ARMTTK' | |
| name: Slash Command ARM-TTK Tests | |
| on: | |
| issue_comment: | |
| types: [created, edited] | |
| permissions: | |
| contents: read | |
| issues: read | |
| pull-requests: read | |
| jobs: | |
| run-arm-ttk: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && github.event.issue.pull_request && contains(fromJson('["/armttk", "/Armttk", "/ARM-TTK", "/ARMTTK", "/arm-ttk", "/ArmTtk"]'), github.event.comment.body) }} | |
| outputs: | |
| solutionName: ${{ steps.step1.outputs.solutionName }} | |
| mainTemplateChanged: ${{ steps.step1.outputs.mainTemplateChanged }} | |
| createUiChanged: ${{ steps.step1.outputs.createUiChanged }} | |
| steps: | |
| - name: Get PR details and validate | |
| id: get-pr | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| }); | |
| // Check if this is a fork PR | |
| const isFork = pr.head.repo.full_name !== context.repo.owner + '/' + context.repo.repo; | |
| if (isFork) { | |
| core.notice('ARM-TTK tests cannot be run on fork PRs for security reasons'); | |
| core.setOutput('is_fork', 'true'); | |
| return; | |
| } | |
| core.setOutput('is_fork', 'false'); | |
| core.setOutput('head_sha', pr.head.sha); | |
| core.setOutput('head_repo', pr.head.repo.full_name); | |
| - name: Checkout PR (secure) | |
| if: steps.get-pr.outputs.is_fork == 'false' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ steps.get-pr.outputs.head_sha }} | |
| persist-credentials: false | |
| - shell: pwsh | |
| if: steps.get-pr.outputs.is_fork == 'false' | |
| id: step1 | |
| name: Identify Changes in PR | |
| run: | | |
| try { | |
| Set-PSRepository PSGallery -InstallationPolicy Trusted | |
| Install-Module powershell-yaml -Force | |
| ./.script/package-automation/arm-ttk-tests.ps1 | |
| } | |
| catch { | |
| Write-Error "Failed to run ARM-TTK tests: $_" | |
| exit 1 | |
| } | |
| - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 | |
| id: publishGithubPackage | |
| name: Run ARM-TTK | |
| if: ${{ steps.get-pr.outputs.is_fork == 'false' && success() && steps.step1.outputs.solutionName != '' && (steps.step1.outputs.mainTemplateChanged == 'true' || steps.step1.outputs.createUiChanged == 'true') }} | |
| with: | |
| context: . | |
| file: ./.github/actions/Dockerfile | |
| push: false | |
| provenance: false | |
| build-args: | | |
| SolutionName=${{ steps.step1.outputs.solutionName }} | |
| mainTemplateChanged=${{ steps.step1.outputs.mainTemplateChanged }} | |
| createUiChanged=${{ steps.step1.outputs.createUiChanged }} |