Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
249c64f
fix(ci): add hash-update branch support and rename provider hash mani…
marc-romu Mar 9, 2026
1811140
ci: fixed github pages deployment (#404)
marc-romu Mar 9, 2026
2c0a0f7
refactor(infrastructure): improve version tag detection and prereleas…
marc-romu Mar 9, 2026
ce6b9e5
Merge branch 'dev' of https://github.com/architects-toolkit/SmartHopp…
marc-romu Mar 9, 2026
a8c7752
refactor(infrastructure): simplify hash display in provider verificat…
marc-romu Mar 9, 2026
8f72cc3
feat(ci): add platform selection and macOS support to Yak upload work…
marc-romu Mar 9, 2026
3111855
chore: bump version to 1.4.2-alpha and fix GhJSON component Id assign…
marc-romu Mar 14, 2026
21dda2c
feat(macos): add macOS provider hash verification support and fix scr…
marc-romu Mar 14, 2026
b7ed01a
Potential fix for pull request finding
marc-romu Mar 14, 2026
59351ca
fix(tools): prevent GhJSON Id missing errors in script_edit and scrip…
marc-romu Mar 14, 2026
720e674
docs: update contributors section for dev
actions-user Mar 14, 2026
286e3d3
docs: update contributors section for dev (#407)
marc-romu Mar 14, 2026
0437ef4
docs: update system requirements to specify Windows and macOS platfor…
marc-romu Mar 14, 2026
eb8623c
chore: prepare release 1.4.2-alpha with version update and code style…
actions-user Mar 14, 2026
3a9046d
chore: prepare release 1.4.2-alpha with version update and code style…
marc-romu Mar 14, 2026
b91724b
feat(ci): add automatic milestone assignment to all PR-creating workf…
marc-romu Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions .github/actions/milestone/assign-pr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: 'Assign PR to Milestone'
description: 'Reads version from Solution.props and assigns a PR to the appropriate milestone, creating it if necessary. Mimics pr-milestone.yml behavior.'

inputs:
pr-number:
description: 'PR number to assign to milestone'
required: true
token:
description: 'GitHub token with issues:write and pull-requests:write permissions'
required: true
working-directory:
description: 'Directory containing Solution.props (defaults to repository root)'
required: false
default: '.'
comment-on-pr:
description: 'Whether to add a comment on the PR about milestone assignment'
required: false
default: 'true'

runs:
using: 'composite'
steps:
- name: Read version and assign to milestone
uses: actions/github-script@v7
with:
github-token: ${{ inputs.token }}
script: |
const fs = require('fs');
const path = require('path');

const workingDir = '${{ inputs.working-directory }}';
const solutionPropsPath = path.join(workingDir, 'Solution.props');

if (!fs.existsSync(solutionPropsPath)) {
console.log('Solution.props file not found at:', solutionPropsPath);
return;
}

const content = fs.readFileSync(solutionPropsPath, 'utf8');
console.log('Solution.props content:', content);

// Extract version from Solution.props
const versionMatch = content.match(/<SolutionVersion>(.*?)<\/SolutionVersion>/);
if (!versionMatch) {
console.log('Could not find SolutionVersion in Solution.props');
return;
}

const fullVersion = versionMatch[1];
console.log('Found full version:', fullVersion);

// Parse and process version
// - Build numbers (e.g., ".250720") are removed because they are not relevant for milestone assignment.
// - The suffix "-dev" is replaced with "-alpha" because there are no milestones for development versions.

let processedVersion = fullVersion;
const lastDotIndex = processedVersion.lastIndexOf('.');
if (lastDotIndex > processedVersion.indexOf('-')) {
// Only remove if the dot is after the dash (part of build number)
processedVersion = processedVersion.substring(0, lastDotIndex);
}

// Replace -dev with -alpha (there are no dev milestones)
processedVersion = processedVersion.replace('-dev', '-alpha');

console.log('Processed version for milestone:', processedVersion);

// Find milestone with matching title
const { data: milestones } = await github.rest.issues.listMilestones({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'all' // Include both open and closed milestones
});

let targetMilestone = milestones.find(milestone => milestone.title === processedVersion);

if (!targetMilestone) {
console.log(`No milestone found with title: ${processedVersion}`);
console.log('Available milestones:', milestones.map(m => m.title));

// Create the milestone if it doesn't exist
console.log(`Creating new milestone: ${processedVersion}`);
try {
const { data: newMilestone } = await github.rest.issues.createMilestone({
owner: context.repo.owner,
repo: context.repo.repo,
title: processedVersion,
description: `Milestone for version ${processedVersion}`,
state: 'open'
});

targetMilestone = newMilestone;
console.log(`Successfully created milestone: ${targetMilestone.title}`);

} catch (error) {
console.error('Error creating milestone:', error);
core.setFailed(`Failed to create milestone: ${error.message}`);
return;
}
} else {
console.log(`Found existing milestone: ${targetMilestone.title} (${targetMilestone.state})`);
}

// Assign PR to milestone
const prNumber = parseInt('${{ inputs.pr-number }}', 10);

try {
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
milestone: targetMilestone.number
});

console.log(`Successfully assigned PR #${prNumber} to milestone "${targetMilestone.title}"`);

// Add a comment to the PR if requested
if ('${{ inputs.comment-on-pr }}' === 'true') {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: `🏷️ This PR has been automatically assigned to milestone **${targetMilestone.title}** based on the version in \`Solution.props\`.`
});
}

} catch (error) {
console.error('Error assigning PR to milestone:', error);
core.setFailed(`Failed to assign PR to milestone: ${error.message}`);
}
14 changes: 13 additions & 1 deletion .github/workflows/chore-update-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ jobs:

- name: Create PR
if: steps.identify-contributors.outputs.has_contributors == 'true' && steps.update-changelog.outputs.changelog_updated == 'true' && env.CHANGES_PUSHED == 'true'
id: create-pr
run: |
PR_TITLE="docs: update contributors section for ${{ env.TARGET_BRANCH }}"
PR_BODY=$(cat << 'EOF'
Expand All @@ -318,6 +319,17 @@ jobs:
This is an automated PR created by the Update Contributors workflow.
EOF)

gh pr create --base ${{ env.TARGET_BRANCH }} --head ${{ env.CONTRIB_BRANCH }} --title "$PR_TITLE" --body "$PR_BODY"
gh pr create --base ${{ env.TARGET_BRANCH }} --head ${{ env.CONTRIB_BRANCH }} --title "$PR_TITLE" --body "$PR_BODY" --json number --jq '.number'

# Capture PR number
PR_NUMBER=$(gh pr list --base ${{ env.TARGET_BRANCH }} --head ${{ env.CONTRIB_BRANCH }} --json number --jq '.[0].number')
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Assign PR to Milestone
if: steps.identify-contributors.outputs.has_contributors == 'true' && steps.update-changelog.outputs.changelog_updated == 'true' && env.CHANGES_PUSHED == 'true' && steps.create-pr.outputs.pr_number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pr_number }}
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/chore-update-copyright-year.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:

- name: Create Pull Request
if: steps.check-changes.outputs.has-changes == 'true'
id: create-pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -76,6 +77,13 @@ jobs:
chore
automated

- name: Assign PR to Milestone
if: steps.check-changes.outputs.has-changes == 'true' && steps.create-pr.outputs.pull-request-number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pull-request-number }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: No changes needed
if: steps.check-changes.outputs.has-changes == 'false'
shell: pwsh
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/chore-version-badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:

- name: Create Pull Request
if: steps.update-badge.outputs.badges-changed == 'true' && steps.check-changes.outputs.has_changes == 'true'
id: create-pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -95,3 +96,10 @@ jobs:
labels: |
documentation
automated

- name: Assign PR to Milestone
if: steps.update-badge.outputs.badges-changed == 'true' && steps.check-changes.outputs.has_changes == 'true' && steps.create-pr.outputs.pull-request-number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pull-request-number }}
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/chore-version-date.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:

- name: Create Pull Request
if: steps.calculate-version.outputs.was-date-updated == 'true' && steps.check-changes.outputs.has_changes == 'true'
id: create-pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -97,3 +98,10 @@ jobs:
labels: |
chore
automated

- name: Assign PR to Milestone
if: steps.calculate-version.outputs.was-date-updated == 'true' && steps.check-changes.outputs.has_changes == 'true' && steps.create-pr.outputs.pull-request-number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pull-request-number }}
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/chore-version-main-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:

- name: Create Pull Request
if: steps.strip-date.outputs.new-version != steps.get-version.outputs.version
id: create-pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -73,3 +74,10 @@ jobs:
labels: |
chore
automated

- name: Assign PR to Milestone
if: steps.strip-date.outputs.new-version != steps.get-version.outputs.version && steps.create-pr.outputs.pull-request-number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pull-request-number }}
token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/hotfix-1-release-hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ jobs:

- name: Create PR to update dev branch if version collision
if: steps.check-dev.outputs.DEV_COLLISION == 'true'
id: create-dev-pr
run: |
# Set branch name for dev version update
DEV_UPDATE_BRANCH="chore/bump-dev-version-for-hotfix-${{ steps.extract-version.outputs.version }}"
Expand Down Expand Up @@ -318,11 +319,22 @@ jobs:

gh pr create --base dev --head $DEV_UPDATE_BRANCH --title "$PR_TITLE" --body "$PR_BODY"

# Capture PR number
DEV_PR_NUMBER=$(gh pr list --base dev --head $DEV_UPDATE_BRANCH --json number --jq '.[0].number')
echo "dev_pr_number=$DEV_PR_NUMBER" >> $GITHUB_OUTPUT

# Return to release branch
git checkout ${{ steps.set-branch.outputs.release_branch }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Assign Dev PR to Milestone
if: steps.check-dev.outputs.DEV_COLLISION == 'true' && steps.create-dev-pr.outputs.dev_pr_number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-dev-pr.outputs.dev_pr_number }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Create Pull Request to main
id: create-pr
run: |
Expand All @@ -331,9 +343,20 @@ jobs:
--head ${{ steps.set-branch.outputs.release_branch }} \
--title "chore: hotfix release ${{ steps.extract-version.outputs.version }}" \
--body $'## 🔥 Hotfix Release ${{ steps.extract-version.outputs.version }}\n\n**Description:** ${{ steps.extract-description.outputs.description }}\n\nThis PR contains a hotfix release that addresses critical issues in production.\n\n### Changes\n\n- Updated version to ${{ steps.extract-version.outputs.version }}\n- Updated CHANGELOG.md with release notes\n- Updated README badges\n\n### Release Process\n\nOnce this PR is merged to main:\n1. A GitHub Release will be created automatically (workflow: release-3-pr-to-main-closed.yml)\n2. The project will be built (workflow: release-4-build.yml)\n3. Artifacts will be uploaded to Yak (workflow: release-5-upload-yak.yml)\n\n⚠️ **Note:** After merging to main, you may want to cherry-pick or merge these changes back to dev to keep it in sync.'

# Capture PR number
PR_NUMBER=$(gh pr list --base main --head ${{ steps.set-branch.outputs.release_branch }} --json number --jq '.[0].number')
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Assign Hotfix PR to Milestone
if: steps.create-pr.outputs.pr_number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pr_number }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update PR description with collision info
if: steps.check-milestones.outputs.result != '' || steps.check-dev.outputs.DEV_COLLISION == 'true'
run: |
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/pr-anonymize-public-key.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ jobs:

- name: Create PR
if: steps.anonymize.outputs.changes_made == 'true' && steps.create-branch.outputs.changes_pushed == 'true'
id: create-pr
shell: pwsh
run: |
$PR_TITLE = "chore: anonymize SmartHopperPublicKey for ${{ steps.set-branches.outputs.target_branch }}"
Expand All @@ -148,6 +149,17 @@ jobs:
This is an automated PR created by the Anonymize Public Key workflow.
'@

gh pr create --base ${{ steps.set-branches.outputs.target_branch }} --head ${{ steps.set-branches.outputs.anon_branch }} --title "$PR_TITLE" --body "$PR_BODY"
$prUrl = gh pr create --base ${{ steps.set-branches.outputs.target_branch }} --head ${{ steps.set-branches.outputs.anon_branch }} --title "$PR_TITLE" --body "$PR_BODY"

# Capture PR number
$PR_NUMBER = gh pr list --base ${{ steps.set-branches.outputs.target_branch }} --head ${{ steps.set-branches.outputs.anon_branch }} --json number --jq '.[0].number'
echo "pr_number=$PR_NUMBER" >> $env:GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Assign PR to Milestone
if: steps.anonymize.outputs.changes_made == 'true' && steps.create-branch.outputs.changes_pushed == 'true' && steps.create-pr.outputs.pr_number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pr_number }}
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/pr-delete-auto-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
startsWith(github.event.pull_request.head.ref, 'hotfix/') ||
startsWith(github.event.pull_request.head.ref, 'bugfix/') ||
startsWith(github.event.pull_request.head.ref, 'bug/') ||
startsWith(github.event.pull_request.head.ref, 'fix/')
startsWith(github.event.pull_request.head.ref, 'fix/') ||
startsWith(github.event.pull_request.head.ref, 'hash-update/')
runs-on: ubuntu-latest
steps:
- name: Delete branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: pr-milestone
on:
pull_request:
types: [opened]
branches: [main, dev, 'release/*']
branches: [main, dev, 'release/*', 'hash-update/*']

permissions:
issues: write
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/release-1-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,16 @@ jobs:
--head release/${{ github.event.milestone.title }} \
--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- Updated version in Solution.props\n- Updated changelog with closed-solved issues\n- Updated README badges'

# Capture PR number
PR_NUMBER=$(gh pr list --base dev --head release/${{ github.event.milestone.title }} --json number --jq '.[0].number')
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Assign PR to Milestone
if: steps.create-pr.outputs.pr_number != ''
uses: ./.github/actions/milestone/assign-pr
with:
pr-number: ${{ steps.create-pr.outputs.pr_number }}
token: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading