chore(deps-dev): bump the vitest group with 4 updates #10497
Workflow file for this run
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
| name: Recommend integration tests | |
| on: | |
| pull_request: | |
| jobs: | |
| recommend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Get source files changes | |
| id: source-files | |
| run: | | |
| DIFF=$(git diff --name-only origin/main | grep 'packages/react' | grep -Ev '.stories.tsx|.stories.module.css|.docs.json' || true) | |
| if [ -z "$DIFF" ]; then | |
| echo "diff=" >> $GITHUB_OUTPUT | |
| else | |
| echo "diff=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Has diff? | |
| run: echo ${{ steps.source-files.outputs.diff != '' }} | |
| - name: Add label and comment | |
| if: ${{ steps.source-files.outputs.diff != '' }} | |
| uses: actions/github-script@5c56fde4671bc2d3592fb0f2c5b5bab9ddae03b1 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const INTEGRATION_LABEL_NAMES = { | |
| // synced with https://github.com/primer/react/labels?q=integration-tests | |
| skipped: 'integration-tests: skipped manually', | |
| recommended: 'integration-tests: recommended', | |
| failing: 'integration-tests: failing', | |
| passing: 'integration-tests: passing' | |
| } | |
| const issue = { | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo | |
| } | |
| const labels = await github.paginate(github.rest.issues.listLabelsOnIssue, issue); | |
| const integrationLabels = labels.filter(label => label.name.startsWith('integration-tests')) | |
| const hasPassingLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.passing) | |
| if (integrationLabels.length === 0) { | |
| // recommend integration tests | |
| await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]}) | |
| await github.rest.issues.createComment({ | |
| ...issue, | |
| body: '<!-- recommend-integration-tests.yml -->\n\n :wave: Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the [integration workflow](https://gh.io/testing_primer_at_dotcom). Or, apply the `integration-tests: skipped manually` label to skip these checks.' | |
| }) | |
| } else if (hasPassingLabel) { | |
| // recommend running integration tests again as there are new commits that might change the status | |
| // note: we don't remove 'integration-tests: passing' label because this is only a suggestion/nudge | |
| await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]}) | |
| await github.rest.issues.createComment({ | |
| ...issue, | |
| body: '<!-- recommend-integration-tests.yml -->\n\n :wave: Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the [integration workflow](https://gh.io/testing_primer_at_dotcom). Or, apply the `integration-tests: skipped manually` label to skip these checks.' | |
| }) | |
| } |