Skip to content

Conversation

@printminion-co
Copy link
Contributor

…le PR on ncw-server

@printminion-co printminion-co force-pushed the mk/dev/update_submodule_workflow branch from b384d20 to 5034a11 Compare November 7, 2025 10:02
Copy link

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 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: false
on:
  push:
    branches:
      - main
  workflow_dispatch:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +110 to +117
git config --global url."https://github.com/".insteadOf "[email protected]:"
git config --global url."https://".insteadOf "ssh://"
Copy link

Copilot AI Nov 7, 2025

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.

Suggested change
git config --global url."https://github.com/".insteadOf "[email protected]:"
git config --global url."https://".insteadOf "ssh://"

Copilot uses AI. Check for mistakes.
Comment on lines +126 to +156
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 ..
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +130 to +158
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 }}"
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines 114 to 151
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 }}"
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.
@printminion-co printminion-co force-pushed the mk/dev/update_submodule_workflow branch from 5034a11 to 5a05877 Compare November 7, 2025 10:08
…le PR on ncw-server

Signed-off-by: Misha M.-Kupriyanov <[email protected]>
@printminion-co printminion-co force-pushed the mk/dev/update_submodule_workflow branch from 8bce9df to fde8fa4 Compare November 7, 2025 10:15
@printminion-co printminion-co merged commit bf59b8f into main Nov 7, 2025
14 checks passed
@printminion-co printminion-co deleted the mk/dev/update_submodule_workflow branch November 7, 2025 10:17
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