-
Notifications
You must be signed in to change notification settings - Fork 1
feat(submodule-workflow): create pre-release and update IONOS submodu… #86
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
b384d20 to
5034a11
Compare
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 transforms the workflow from a simple repository dispatch trigger to a comprehensive automated release and submodule update system. The workflow now creates GitHub pre-releases and automatically generates pull requests in the ncw-server repository when changes are merged to the main branch.
- Creates pre-releases with auto-generated release notes for each commit to main
- Automatically updates the IONOS submodule in ncw-server repository and creates a PR
- Migrates from self-hosted to ubuntu-latest runners
Comments suppressed due to low confidence (1)
.github/workflows/submodule-trigger-workflow.yml:9
- The workflow doesn't include concurrency controls, which means multiple pushes to main in quick succession could create multiple pre-releases with the same short SHA (if commits have the same first 7 characters) or trigger multiple PR creation attempts. Consider adding a concurrency group to ensure only one workflow runs at a time:
concurrency:
group: submodule-update
cancel-in-progress: falseon:
push:
branches:
- main
workflow_dispatch:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| git config --global url."https://github.com/".insteadOf "[email protected]:" | ||
| git config --global url."https://".insteadOf "ssh://" |
Copilot
AI
Nov 7, 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.
The global Git URL rewrite configuration may not be necessary and could potentially cause issues. The actions/checkout@v5 action with the token parameter should already configure Git to use HTTPS with the provided PAT. These global rewrites (lines 110-111) might interfere with that configuration. Additionally, for the git submodule update --init command to work with private repositories, you may need to ensure the submodule URL in .gitmodules uses HTTPS, or configure Git credentials explicitly. Consider testing if these lines can be removed, or add explicit credential configuration if submodule authentication fails.
| git config --global url."https://github.com/".insteadOf "[email protected]:" | |
| git config --global url."https://".insteadOf "ssh://" |
| COMMIT_MSG=$(git log -1 --pretty=format:'%s') | ||
| cd .. | ||
| # Commit the submodule update with release link | ||
| RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ needs.create-prerelease.outputs.short_sha }}" | ||
| git add IONOS | ||
| git commit -m "IONOS(config): update submodule ${{ needs.create-prerelease.outputs.short_sha }} ($COMMIT_MSG)" \ | ||
| -m "" \ | ||
| -m "$RELEASE_URL" \ | ||
| -m "" \ | ||
| -m "Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | ||
| # Push the branch | ||
| git push origin "$BRANCH_NAME" | ||
| - name: Create Pull Request | ||
| env: | ||
| GH_TOKEN: ${{ secrets.NCW_SERVER_PAT }} | ||
| run: | | ||
| BRANCH_NAME="update-ionos-submodule-${{ needs.create-prerelease.outputs.short_sha }}" | ||
| # Get the commit message from IONOS submodule | ||
| cd IONOS | ||
| COMMIT_MSG=$(git log -1 --pretty=format:'%s') | ||
| cd .. |
Copilot
AI
Nov 7, 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.
The COMMIT_MSG variable is retrieved twice (lines 126 and 149) from the IONOS submodule, which is redundant. Consider setting it once as an environment variable or output in the "Update IONOS submodule" step and reusing it in the "Create Pull Request" step to improve maintainability.
| RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ needs.create-prerelease.outputs.short_sha }}" | ||
| git add IONOS | ||
| git commit -m "IONOS(config): update submodule ${{ needs.create-prerelease.outputs.short_sha }} ($COMMIT_MSG)" \ | ||
| -m "" \ | ||
| -m "$RELEASE_URL" \ | ||
| -m "" \ | ||
| -m "Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | ||
| # Push the branch | ||
| git push origin "$BRANCH_NAME" | ||
| - name: Create Pull Request | ||
| env: | ||
| GH_TOKEN: ${{ secrets.NCW_SERVER_PAT }} | ||
| run: | | ||
| BRANCH_NAME="update-ionos-submodule-${{ needs.create-prerelease.outputs.short_sha }}" | ||
| # Get the commit message from IONOS submodule | ||
| cd IONOS | ||
| COMMIT_MSG=$(git log -1 --pretty=format:'%s') | ||
| cd .. | ||
| RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ needs.create-prerelease.outputs.short_sha }}" |
Copilot
AI
Nov 7, 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.
The RELEASE_URL is constructed twice (lines 130 and 152) with identical logic. This duplication should be avoided. Consider constructing it once in the "Update IONOS submodule" step and exporting it as an environment variable or job output for reuse in the "Create Pull Request" step.
| BRANCH_NAME="update-ionos-submodule-${{ needs.create-prerelease.outputs.short_sha }}" | ||
| git checkout -b "$BRANCH_NAME" | ||
| # Initialize only the IONOS submodule | ||
| git submodule update --init IONOS | ||
| # Update the submodule to the new commit | ||
| cd IONOS | ||
| git fetch origin main | ||
| git checkout ${{ needs.create-prerelease.outputs.sha }} | ||
| # Get the commit message for description | ||
| COMMIT_MSG=$(git log -1 --pretty=format:'%s') | ||
| cd .. | ||
| # Commit the submodule update with release link | ||
| RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ needs.create-prerelease.outputs.short_sha }}" | ||
| git add IONOS | ||
| git commit -m "IONOS(config): update submodule ${{ needs.create-prerelease.outputs.short_sha }} ($COMMIT_MSG)" \ | ||
| -m "" \ | ||
| -m "$RELEASE_URL" \ | ||
| -m "" \ | ||
| -m "Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | ||
| # Push the branch | ||
| git push origin "$BRANCH_NAME" | ||
| - name: Create Pull Request | ||
| env: | ||
| GH_TOKEN: ${{ secrets.NCW_SERVER_PAT }} | ||
| run: | | ||
| BRANCH_NAME="update-ionos-submodule-${{ needs.create-prerelease.outputs.short_sha }}" |
Copilot
AI
Nov 7, 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.
The BRANCH_NAME is constructed twice (lines 114 and 145) with identical logic. This duplication should be avoided. Since it's used across different steps in the same job, consider setting it as an environment variable at the job level or export it from the first step for consistency and maintainability.
5034a11 to
5a05877
Compare
…le PR on ncw-server Signed-off-by: Misha M.-Kupriyanov <[email protected]>
8bce9df to
fde8fa4
Compare
…le PR on ncw-server