[chore] [exporter/signalfx] enable cpu attr in per-core changelog example #2
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: 'First time contributor' | |
| on: | |
| pull_request_target: | |
| types: | |
| - opened | |
| - ready_for_review | |
| permissions: read-all | |
| jobs: | |
| welcome_first_contributor: | |
| permissions: | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| if: github.event.action == 'opened' && github.repository_owner == 'open-telemetry' && (github.event.pull_request.author_association == 'NONE' || github.event.label.name == 'first-contrib-test') | |
| steps: | |
| - run: gh pr edit "$NUMBER" --add-label "$LABELS" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| NUMBER: ${{ github.event.pull_request.number }} | |
| LABELS: 'first-time contributor' | |
| - name: Comment on PR | |
| uses: actions-ecosystem/action-create-comment@e23bc59fbff7aac7f9044bd66c2dc0fe1286f80b # v1.0.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| body: | | |
| Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. | |
| **Important reminders:** | |
| - Read our [Contributing Guidelines](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md). | |
| - Sign the [CLA](https://identity.linuxfoundation.org/projects/cncf) if you haven't already. | |
| - First-time contributors should have **at most one PR not marked as draft until their first PR is merged**. | |
| - If your change isn't one of our [priority components](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/44130), reviews may take more time. | |
| - Give reviewers at least a few days before pinging them for feedback. | |
| - If you need help or struggle to move your PR forward: | |
| - Ask questions regarding general setup, development process, or contributor etiquette in [#opentelemetry-new-contributors](https://cloud-native.slack.com/archives/C09H3MNMBQV). | |
| - Raise technical or Collector-specific questions in [#otel-collector-dev](https://cloud-native.slack.com/archives/C07CCCMRXBK) or a [Collector SIG meeting](https://github.com/open-telemetry/community?tab=readme-ov-file#sig-collector). | |
| draft_if_multiple_prs: | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.repository_owner == 'open-telemetry' && | |
| github.event.pull_request.author_association == 'NONE' && | |
| github.event.pull_request.draft == false && | |
| !contains(github.event.pull_request.labels.*.name, 'keep-as-non-draft') | |
| steps: | |
| - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| id: otelbot-token | |
| with: | |
| app-id: ${{ vars.OTELBOT_APP_ID }} | |
| private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} | |
| permission-pull-requests: write | |
| # Allow up to two non-draft PRs so that the author can change which PR they mark as ready for review. | |
| - name: Convert to draft if author has two previous non-draft PRs open | |
| env: | |
| GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} | |
| GH_REPO: ${{ github.repository }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PR_AUTHOR: ${{ github.event.pull_request.user.login }} | |
| run: | | |
| set -euo pipefail | |
| raw=$(gh pr list --author "$PR_AUTHOR" --state open --json number,isDraft) | |
| count=$(echo "$raw" | jq --argjson current "$PR_NUMBER" \ | |
| '[.[] | select(.isDraft == false and .number < $current)] | length') | |
| if [ "$count" -lt 2 ]; then | |
| echo "$PR_AUTHOR has $count other non-draft PR(s) open; allowing up to 2." | |
| exit 0 | |
| fi | |
| search_url="https://github.com/${GH_REPO}/pulls?q=is%3Apr+is%3Aopen+draft%3Afalse+author%3A${PR_AUTHOR}" | |
| gh pr ready --undo "$PR_NUMBER" | |
| { | |
| printf 'This pull request is now a draft because you already have [other pull requests open for review](%s).\n\n' "$search_url" | |
| printf 'Until your first pull request is merged, please keep only one open for review.\n' | |
| } | gh pr comment "$PR_NUMBER" --body-file - |