- 
                Notifications
    You must be signed in to change notification settings 
- Fork 132
Add detect-pr-label job to manage package publishing based on PR labels #829
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
Conversation
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.
Pull Request Overview
This PR adds a conditional publishing mechanism to the main workflow by introducing a detect-pr-label job that checks for a skip label on merged pull requests. The workflow now only publishes packages to NuGet and Azure Artifacts when the merged PR doesn't contain the skip-nuget-publish label.
- Adds a new job to detect PR labels and determine if publishing should be skipped
- Modifies existing publish jobs to depend on the label detection and conditionally run
- Adds workflow permissions for reading repository contents and pull requests
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
This PR adds a new workflow job to detect PR labels and control package publishing based on whether a merged PR contains a skip label. The feature allows developers to prevent automatic package publishing by adding a configurable label to their pull requests.
Key changes:
- Added a new detect-pr-labeljob that checks for a skip label on merged PRs
- Modified publishing jobs to conditionally run based on the label detection
- Added proper permissions for reading pull request information
| env: | ||
| # Change this label name to whatever you use to skip publishing. | ||
| SKIP_PUBLISH_LABEL: skip-nuget-publish | ||
| steps: | 
    
      
    
      Copilot
AI
    
    
    
      Sep 2, 2025 
    
  
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.
Missing step name before the id field. GitHub Actions requires a name field or the step will use a default name. Add - name: Check for skip label before the id field.
Note: See the diff below for a potential fix:
@@ -164,6 +164,7 @@
       # Change this label name to whatever you use to skip publishing.
       SKIP_PUBLISH_LABEL: skip-nuget-publish
     steps:
+        name: Check for skip label
         id: check
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| 
 Minimum allowed line rate is  | 
No description provided.