Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 16 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ jobs:

- name: Deploy container locally
run: |
IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_deploy:latest
IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

IMAGE is set to .../control_dev:latest, but this workflow currently builds/tags .../control_deploy:latest earlier in the job. As written, docker run $IMAGE will either fail (image not found) or pull a different image than the one just built. Align the image name/tag between the build step and the deploy step.

Suggested change
IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest
IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_deploy:latest

Copilot uses AI. Check for mistakes.
docker stop CONTROL_DEPLOY || true
docker rm CONTROL_DEPLOY || true
docker run -d --name CONTROL_DEPLOY -p 8081:8081 $IMAGE
docker run -d --name CONTROL_DEPLOY -p 8083:8081 --restart=always \
--add-host host.docker.internal:host-gateway \
-e CORES="${{ secrets.CORES }}" \
-e DB_USER="${{ secrets.DB_USER }}" \
-e DB_PASSWORD="${{ secrets.DB_PASSWORD }}" \
Comment on lines +27 to +31

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The docker run command uses \\ at end-of-line for continuation inside the bash script. In bash, \\ escapes the second backslash and does not escape the newline, so the command will break into multiple commands. Use a single trailing \ for line continuation (or remove continuations and keep it on one line).

Copilot uses AI. Check for mistakes.
-e DB_HOST="${{ secrets.DB_HOST }}" \
-e DB_NAME="${{ secrets.DB_NAME }}" \
-e GUAC_DB_USER="${{ secrets.GUAC_DB_USER }}" \
-e GUAC_DB_PASSWORD="${{ secrets.GUAC_DB_PASSWORD }}" \
-e GUAC_DB_HOST="${{ secrets.GUAC_DB_HOST }}" \
-e GUAC_DB_NAME="${{ secrets.GUAC_DB_NAME }}" \
-e REDIS_HOST="${{ secrets.REDIS_HOST }}" \
-e CMS_HOST="${{ secrets.CMS_HOST }}" \
-e GUAC_BASE_URL="${{ secrets.GUAC_BASE_URL }}" \
$IMAGE
docker system prune -af
38 changes: 38 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PR Build Verification

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The PR title/description don't describe the intent or expected behavior of these workflow changes (they still contain the template placeholders). Please update the PR description to explain what the new PR build check is for and why the deploy workflow’s container settings (ports/env vars/image name) changed.

Copilot uses AI. Check for mistakes.

on:
pull_request:
branches:
- Dev

jobs:
build-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'

- name: Download Go modules
run: go mod download

- name: Build
run: go build -o main .

- name: Comment on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
await github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'REQUEST_CHANGES',
body: 'Failed To BUILD! Please check the build logs for details.'
Comment on lines +27 to +37

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The actions/github-script step calls pulls.createReview, which requires pull-requests: write permission. This workflow doesn't set explicit permissions, so the step may fail (especially on orgs that default GITHUB_TOKEN to read-only / on fork PRs). Consider adding permissions: pull-requests: write (and gating fork PRs if needed) so the failure comment is reliable.

Copilot uses AI. Check for mistakes.
});
Comment on lines +13 to +38

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

steps: list items are not indented under steps. With the current indentation, the - name: ... entries become siblings of steps and the workflow YAML will not parse. Indent step items under steps: (e.g., steps: then - name:).

Suggested change
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'
- name: Download Go modules
run: go mod download
- name: Build
run: go build -o main .
- name: Comment on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
await github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'REQUEST_CHANGES',
body: 'Failed To BUILD! Please check the build logs for details.'
});
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'
- name: Download Go modules
run: go mod download
- name: Build
run: go build -o main .
- name: Comment on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
await github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'REQUEST_CHANGES',
body: 'Failed To BUILD! Please check the build logs for details.'
});

Copilot uses AI. Check for mistakes.
Loading