Add README documentation for Compose Carousel component #3728
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: PR | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| Build: | |
| name: Build | |
| permissions: | |
| statuses: write | |
| pull-requests: write | |
| contents: write | |
| uses: ./.github/workflows/_build.yml | |
| secrets: | |
| GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| Dependabot: | |
| runs-on: ubuntu-24.04-16cores-public | |
| permissions: | |
| pull-requests: write | |
| if: ${{ github.actor == 'dependabot[bot]' }} | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| - name: Fetch Dependabot metadata | |
| id: dependabot-metadata | |
| uses: dependabot/[email protected] | |
| with: | |
| github-token: "${{ steps.app-token.outputs.token }}" | |
| - name: Add bpk label | |
| if: contains(steps.dependabot-metadata.outputs.dependency-names, 'bpk-') | |
| run: gh pr edit "$PR_URL" --add-label "bpk" --remove-label "javascript" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| - name: Apply dependency labels | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const prNumber = context.issue.number; | |
| const updateType = '${{ steps.metadata.outputs.update-type }}'; | |
| // Get current labels | |
| const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: prNumber | |
| }); | |
| const currentLabelNames = currentLabels.map(label => label.name); | |
| const conflictingLabels = ['major', 'minor', 'patch']; | |
| // Remove conflicting labels if they exist | |
| for (const conflictingLabel of conflictingLabels) { | |
| if (currentLabelNames.includes(conflictingLabel)) { | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: prNumber, | |
| name: conflictingLabel | |
| }); | |
| console.log(`Removed conflicting label: ${conflictingLabel}`); | |
| } | |
| } | |
| // Determine specific dependency label based on update type | |
| let specificLabel = null; | |
| switch (updateType) { | |
| case 'version-update:semver-major': | |
| case 'version-update:semver-premajor': | |
| specificLabel = 'majorDependency'; | |
| break; | |
| case 'version-update:semver-minor': | |
| case 'version-update:semver-preminor': | |
| specificLabel = 'minorDependency'; | |
| break; | |
| case 'version-update:semver-patch': | |
| case 'version-update:semver-prepatch': | |
| specificLabel = 'patchDependency'; | |
| break; | |
| default: | |
| console.log(`Unknown update type: ${updateType}, will use dependencies only`); | |
| } | |
| const labelsToAdd = []; | |
| // Add the dependencies label if it's not already present (required for CI) | |
| if (!currentLabelNames.includes('dependencies')) { | |
| labelsToAdd.push('dependencies'); | |
| } | |
| // Add specific dependency label if determined and not already present | |
| if (specificLabel && !currentLabelNames.includes(specificLabel)) { | |
| labelsToAdd.push(specificLabel); | |
| } | |
| if (labelsToAdd.length > 0) { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: prNumber, | |
| labels: labelsToAdd | |
| }); | |
| console.log(`Added labels: ${labelsToAdd.join(', ')}`); | |
| } else { | |
| console.log('All required labels already present'); | |
| } | |
| CopilotAgent: | |
| runs-on: ubuntu-24.04-16cores-public | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| - name: Detect Copilot commits and label PR | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const { data: commits } = await github.rest.pulls.listCommits({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.payload.pull_request.number | |
| }); | |
| const isCopilot = commits.some(commit => { | |
| const authorLogin = commit.author?.login || ""; | |
| const committerLogin = commit.committer?.login || ""; | |
| const message = commit.commit.message || ""; | |
| const hasAuthorCopilot = /copilot/i.test(authorLogin) || | |
| /copilot/i.test(committerLogin); | |
| const hasCoAuthorCopilot = /co-authored-by:\s*.*copilot/i.test(message); | |
| return hasAuthorCopilot || hasCoAuthorCopilot; | |
| }); | |
| if (isCopilot) { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| labels: ['ai: copilot'] | |
| }); | |
| } |