|
18 | 18 | NX_VERBOSE_LOGGING: true
|
19 | 19 |
|
20 | 20 | jobs:
|
| 21 | + debug: |
| 22 | + if: github.repository_owner == 'microsoft' && github.event_name == 'pull_request' |
| 23 | + runs-on: ubuntu-latest |
| 24 | + permissions: |
| 25 | + contents: 'read' |
| 26 | + actions: 'read' |
| 27 | + steps: |
| 28 | + - name: Get Pull Request Details |
| 29 | + id: pr_details |
| 30 | + uses: actions/github-script@v7 |
| 31 | + with: |
| 32 | + script: | |
| 33 | + const response = await github.rest.pulls.get({ |
| 34 | + owner: context.repo.owner, |
| 35 | + repo: context.repo.repo, |
| 36 | + pull_number: context.issue.number, |
| 37 | + }); |
| 38 | +
|
| 39 | + console.log({issue:context.issue}) |
| 40 | +
|
| 41 | + return response.data; |
| 42 | +
|
| 43 | + - name: Debug |
| 44 | + run: | |
| 45 | + echo "${{ fromJson(steps.pr_details.outputs.result).head.ref }}" |
| 46 | + echo "${{ fromJson(steps.pr_details.outputs.result).head.repo.full_name }}" |
| 47 | + echo '========' |
| 48 | + echo $W_RUN |
| 49 | + echo '========' |
| 50 | + echo "${{steps.pr_details.outputs.result}}" |
| 51 | + env: |
| 52 | + W_RUN: ${{ toJSON(github.event) }} |
| 53 | + |
| 54 | + - name: Checkout Forked Repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + ref: ${{ fromJson(steps.pr_details.outputs.result).head.ref }} |
| 58 | + repository: ${{ fromJson(steps.pr_details.outputs.result).head.repo.full_name }} |
| 59 | + fetch-depth: 10 |
| 60 | + |
| 61 | + - name: Debug2 |
| 62 | + run: | |
| 63 | + echo "--base ${{ fromJson(steps.pr_details.outputs.result).base.sha }} --head ${{ fromJson(steps.pr_details.outputs.result).head.sha }}" |
| 64 | + echo "====" |
| 65 | + git status |
| 66 | + echo '====' |
| 67 | + ls -la packages/react-components/react-text/visual-regression |
| 68 | +
|
| 69 | + - name: Configure Git |
| 70 | + run: | |
| 71 | + git config user.email "${{ github.actor }}@users.noreply.github.com" |
| 72 | + git config user.name "${{ github.actor }}" |
| 73 | +
|
| 74 | + - name: commit |
| 75 | + run: | |
| 76 | + touch packages/react-components/react-text/visual-regression/hello.txt |
| 77 | + git status |
| 78 | + git add *.txt |
| 79 | + git commit -m "chore: test by bot" |
| 80 | + git push origin ${{ fromJson(steps.pr_details.outputs.result).head.ref }} |
| 81 | +
|
21 | 82 | approve_vrt_diff:
|
22 | 83 | if: github.repository_owner == 'microsoft' && github.event.issue.pull_request && contains(github.event.comment.body,'/approve-visual-regression-diff')
|
23 | 84 | runs-on: ubuntu-latest
|
|
0 commit comments