Conversation
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: dev | ||
| - name: Set up Git user | ||
| run: | | ||
| git config user.name "github-actions" | ||
| git config user.email "action@github.com" | ||
| - name: Create release branch | ||
| run: git checkout -b release/${{ github.event.milestone.title }} | ||
| - name: Update version in Solution.props | ||
| uses: ./.github/actions/versioning/update-version | ||
| with: | ||
| new-version: ${{ github.event.milestone.title }} | ||
| - name: Include missing issues in changelog | ||
| uses: ./.github/actions/documentation/update-changelog-issues | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| days-lookback: 90 | ||
| - name: Update changelog section | ||
| uses: ./.github/actions/documentation/update-changelog | ||
| with: | ||
| action: create-release | ||
| version: ${{ github.event.milestone.title }} | ||
| - name: Fix code style | ||
| uses: ./.github/actions/code-style | ||
| with: | ||
| mode: fix | ||
| commit: false | ||
| - name: Commit and push changes | ||
| run: | | ||
| git add Solution.props CHANGELOG.md | ||
| git commit -m "chore: prepare release ${{ github.event.milestone.title }} with version update and code style fixes" | ||
| git push origin release/${{ github.event.milestone.title }} | ||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| title: "chore: prepare release ${{ github.event.milestone.title }} with version update and code style fixes" | ||
| body: "This PR prepares the release for version ${{ github.event.milestone.title }} with version update and code style fixes:\n\n- Fixed header code style\n- Sorted usings\n- Removed trailing whitespace\n- Updated version in Solution.props\n- Updated changelog with closed-solved issues\n\nMILESTONE DESCRIPTION:\n${{ github.event.milestone.description }}" | ||
| base: dev | ||
| branch: release/${{ github.event.milestone.title }} | ||
| milestone: ${{ github.event.milestone.number }} No newline at end of file |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the issue, we need to add a permissions block at the root of the workflow file. This block will define the minimal permissions required for the workflow to function correctly. Based on the workflow's actions, the following permissions are required:
contents: writeto create and push changes to the release branch.issues: readto read issue information for release notes.pull-requests: writeto create a pull request.
The permissions block should be added immediately after the name field in the workflow file.
| @@ -1,2 +1,6 @@ | ||
| name: 🏁 1 Prepare Release on Milestone Close | ||
| permissions: | ||
| contents: write | ||
| issues: read | ||
| pull-requests: write | ||
|
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates our GitHub workflows and custom actions to streamline release management and improve code style enforcement. Key changes include:
- Updating workflow names, triggers, and steps in release-related workflows.
- Introducing new workflows for PR merging from Dev to Main and milestone-based release preparation.
- Removing commit-and-push steps from code-style actions to delegate change management.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/release-4-build.yml | Updated the build project step naming and cleaned up trigger comments. |
| .github/workflows/release-3-pr-to-main-closed.yml | Revised release creation workflow with updated checkout and release note generation steps. |
| .github/workflows/release-2-pr-to-dev-closed.yml | Added a new workflow for auto-creating PRs from release branches in Dev to Main. |
| .github/workflows/release-1-milestone.yml | Introduced a workflow to prepare a release branch when a milestone closes. |
| .github/workflows/chore-version-badge.yml | Enhanced badge update workflow via added paths filtering logic. |
| .github/actions/code-style/* | Removed auto commit-and-push steps from several code-style custom actions. |
| echo "MILESTONE_TITLE=${{ github.event.milestone.title }}" >> $GITHUB_ENV | ||
| echo "MILESTONE_DESCRIPTION<<EOF" >> $GITHUB_ENV | ||
| echo "${{ github.event.milestone.description }}" >> $GITHUB_ENV | ||
| VERSION=$(grep -oPm1 "(?<=<Version>)[^<]+" Solution.props) |
There was a problem hiding this comment.
Consider adding error handling to ensure the grep command successfully retrieves a release version, to prevent workflow failures if the expected pattern is missing.
| VERSION=$(grep -oPm1 "(?<=<Version>)[^<]+" Solution.props) | |
| VERSION=$(grep -oPm1 "(?<=<Version>)[^<]+" Solution.props) | |
| if [ -z "$VERSION" ]; then | |
| echo "Error: Failed to extract version from Solution.props. Ensure the <Version> tag exists and is correctly formatted." >&2 | |
| exit 1 | |
| fi |
| git config user.name "github-actions" | ||
| git config user.email "action@github.com" | ||
| - name: Create release branch | ||
| run: git checkout -b release/${{ github.event.milestone.title }} |
There was a problem hiding this comment.
The branch name derived directly from the milestone title may include spaces or special characters that are invalid in branch names; consider sanitizing the milestone title before using it to create the branch.
| run: git checkout -b release/${{ github.event.milestone.title }} | |
| run: | | |
| sanitized_title=$(echo "${{ github.event.milestone.title }}" | tr '[:upper:]' '[:lower:]' | tr -s ' ' '-' | tr -cd 'a-z0-9-') | |
| git checkout -b release/${sanitized_title} |
No description provided.