-
Notifications
You must be signed in to change notification settings - Fork 144
Add labeler #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add labeler #368
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| changelog: | ||
| exclude: | ||
| labels: | ||
| - skip changelog | ||
| categories: | ||
| - title: 💣 Breaking Changes | ||
| labels: | ||
| - change | ||
| - title: 🚀 Features | ||
| labels: | ||
| - enhancement | ||
| - title: 🐛 Bug Fixes | ||
| labels: | ||
| - bug | ||
| - title: 🧪 Tests | ||
| labels: | ||
| - tests | ||
| - title: 🔨 Maintenance | ||
| labels: | ||
| - chore | ||
| - title: 📝 Documentation | ||
| labels: | ||
| - documentation | ||
| - title: ⬆️ Dependencies | ||
| labels: | ||
| - dependencies | ||
| - title: Other Changes | ||
| labels: | ||
| - "*" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,29 @@ | |
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref_name }}-ci | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| release-notes: | ||
| name: Create/Update release notes | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-24.04 | ||
|
lucacome marked this conversation as resolved.
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Create/Update Draft | ||
| uses: lucacome/draft-release@v2.2.1 | ||
|
|
||
| with: | ||
| minor-label: "enhancement" | ||
| major-label: "change" | ||
| publish: ${{ github.ref_type == 'tag' }} | ||
| collapse-after: 50 | ||
| if: github.event_name != 'pull_request' | ||
|
Comment on lines
+47
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/ci.yml
printf '%s\n' '--- relevant workflow declarations ---'
rg -n -C 3 '^(on:| push:| branches:| tags:| pull_request:|permissions:|jobs:| release-notes:| permissions:| uses:| with:| publish:| if:)' .github/workflows/ci.yml
printf '%s\n' '--- release action references ---'
rg -n -C 3 'lucacome/draft-release|draft-release|release-notes' .github . 2>/dev/null | head -200Repository: opentracing-contrib/java-spring-cloud Length of output: 4925 Add a tag trigger for publishing. This workflow listens only to 🤖 Prompt for AI Agents |
||
|
|
||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Pull Request Labeler | ||
| on: | ||
| - pull_request_target | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| triage: | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| sparse-checkout: | | ||
| labeler.yml | ||
| sparse-checkout-cone-mode: false | ||
| repository: opentracing-contrib/common | ||
|
|
||
| - uses: actions/labeler@v7 | ||
| continue-on-error: true | ||
|
Comment on lines
+22
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/labeler.yml
printf '%s\n' '--- related references ---'
rg -n --hidden --glob '!node_modules' 'actions/(labeler|checkout)@|pull_request_target|continue-on-error|permissions:|contents:|pull-requests:' .github/workflows .github 2>/dev/null || trueRepository: opentracing-contrib/java-spring-cloud Length of output: 3098 Remove A permission, configuration, or API error can leave pull request labels stale while the workflow reports success. Keep this setting only if label updates are intentionally best effort. 🤖 Prompt for AI Agents |
||
| with: | ||
| repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| sync-labels: true | ||
| configuration-path: labeler.yml | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: opentracing-contrib/java-spring-cloud
Length of output: 4961
🏁 Script executed:
Repository: opentracing-contrib/java-spring-cloud
Length of output: 1186
🌐 Web query:
GitHub Actions workflow syntax job permissions GITHUB_TOKEN pull_request fork read-only job-level permissions actions checkout persist credentials💡 Result:
In GitHub Actions, the GITHUB_TOKEN is an automatically generated, short-lived authentication token used to interact with the GitHub API within a workflow [1][2]. Its permissions can be configured at the workflow or job level using the permissions key in the YAML file [3][4]. Key security behaviors include: 1. Fork Pull Request Restrictions: For security, workflows triggered by pull requests from forked repositories automatically receive a read-only GITHUB_TOKEN, regardless of explicitly defined permissions [1]. This is a safety measure to prevent unauthorized write access from untrusted code [5]. The exception to this rule is the pull_request_target event, which runs in the context of the base repository and can be granted higher permissions [5][6]. 2. Job-Level Permissions: You can use the permissions key within a specific job to apply the principle of least privilege [7][3]. Any permission not explicitly listed in the permissions block is set to none [1][3]. 3. actions/checkout and persist-credentials: By default, the actions/checkout action configures a local git credential helper, persisting the GITHUB_TOKEN (or another provided token) into the local.git/config file to allow subsequent git commands to run authenticated [8][9]. 4. Hardening and persist-credentials: Setting persist-credentials: false is a common security hardening practice [10][11]. This prevents the token from being written to the runner's disk, which is particularly important when checking out untrusted code (such as fork PRs) or when you intend to use a different, more specific token for authenticated git operations (like a Personal Access Token) to avoid the default token overriding your desired credentials [9][10][11]. If the default token is read-only and you attempt a git push, operations will fail with a 403 error; disabling credential persistence allows you to configure specific credentials for that push [12][9].
Citations:
How the permissions are calculated for a workflow jobgithub/docs#32398🌐 Web query:
lucacome/draft-release v2.2.1 required permissions contents write GitHub Marketplace💡 Result:
Yes, the lucacome/draft-release action requires contents: write permissions to function correctly, as it needs to create or update release drafts within your repository [1][2]. This requirement applies to version 2.2.1 and earlier versions [1][3]. To grant this access when using the default GITHUB_TOKEN, you should explicitly set the permissions in your GitHub Actions workflow file at the job level [1][3]: permissions: contents: write Alternatively, if you are using a personal access token (PAT), it must be configured with sufficient scopes to manage repository releases [1][4]. Providing this permission is necessary because GitHub's default token settings often restrict write access to repository content for security reasons [4][3].
Citations:
🌐 Web query:
site:docs.github.com GitHub Actions jobs.<job_id>.if skipped job permissions pull_request same repository GITHUB_TOKEN write💡 Result:
When a GitHub Actions job is skipped due to a conditional (
jobs.<job_id>.if), it is marked with a status of "Success" [1][2][3]. Because it reports a successful status, it will not block a pull request from merging, even if it is configured as a required status check [1][2]. In contrast, if an entire workflow run is skipped due to path filtering, branch filtering, or commit message instructions (e.g.,[skip ci]), the associated checks remain in a "Pending" state and will block a pull request from merging [4][5][6][3]. RegardingGITHUB_TOKENpermissions: 1. Scope: TheGITHUB_TOKENis scoped to the repository that contains the workflow [7]. 2. Modifying Permissions: You can use thepermissionskey at the workflow or job level to modify theGITHUB_TOKENaccess [8][4][5]. This allows you to grant the minimum required permissions (e.g.,pull-requests: writeorcontents: write) for specific jobs [8][4][9]. 3. Default Permissions: By default, theGITHUB_TOKENpermissions are determined by the repository or organization settings [9]. In many cases, it may have read-only access by default [9]. 4. Security: It is a best practice to use thepermissionskey to restrict theGITHUB_TOKENto the least privilege necessary, regardless of whether a job runs or is skipped [8][4][10]. Since a skipped job does not execute, anypermissionsdefined within that specific job block will not be exercised, as no actions or run commands within that job will run [4][5].Citations:
🌐 Web query:
site:docs.github.com GitHub Actions push branches filter tags workflow runs when branches is specified💡 Result:
When you define a branches filter in a GitHub Actions workflow for the push event, the workflow will not run for tags [1][2][3]. According to official GitHub documentation, if you define only branches (or branches-ignore) and do not define any tags (or tags-ignore) filters, the workflow will not run for events affecting tags [1][2]. Conversely, if you define only tags filters, the workflow will not run for events affecting branches [1][2]. If you want your workflow to run for both branches and tags, you must explicitly define filters for both or omit all of these filters entirely [1][2][3]. When you omit all branch and tag filters, the workflow will trigger for pushes to both branches and tags [1][2]. If you choose to use both, you can define them in the same workflow file as follows [3]: on: push: branches: - main - 'releases/' tags: - v2 - v1.* In this configuration, the workflow will trigger for pushes to the specified branches and the specified tags [3].
Citations:
Scope
contents: writeto non-PR runs.lucacome/draft-release@v2.2.1needscontents: writeto manage releases. However, same-repository pull requests can receive this write permission. Therelease-notesjob starts and runsactions/checkoutbefore the step condition is evaluated. Move the condition to the job and remove the step-level condition. The configuredpush.branches: masterfilter does not trigger this workflow for tag pushes.Proposed fix
🤖 Prompt for AI Agents