Skip to content

Conversation

@marc-romu
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings May 6, 2025 09:41
Comment on lines +22 to +66
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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

Copilot Autofix

AI 9 months 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: write to create and push changes to the release branch.
  • issues: read to read issue information for release notes.
  • pull-requests: write to create a pull request.

The permissions block should be added immediately after the name field in the workflow file.


Suggested changeset 1
.github/workflows/release-1-milestone.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/release-1-milestone.yml b/.github/workflows/release-1-milestone.yml
--- a/.github/workflows/release-1-milestone.yml
+++ b/.github/workflows/release-1-milestone.yml
@@ -1,2 +1,6 @@
 name: 🏁 1 Prepare Release on Milestone Close
+permissions:
+  contents: write
+  issues: read
+  pull-requests: write
 
EOF
@@ -1,2 +1,6 @@
name: 🏁 1 Prepare Release on Milestone Close
permissions:
contents: write
issues: read
pull-requests: write

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@marc-romu marc-romu merged commit 6eea98a into dev May 6, 2025
10 of 15 checks passed
Copy link
Contributor

Copilot AI left a 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 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)
Copy link

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling to ensure the grep command successfully retrieves a release version, to prevent workflow failures if the expected pattern is missing.

Suggested change
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

Copilot uses AI. Check for mistakes.
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 }}
Copy link

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants