diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f0203d2..3e30dbf 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build and tag Docker image run: | diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 1d7064d..62c7d7b 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build and tag Docker image run: | diff --git a/.github/workflows/pr-build-check.yaml b/.github/workflows/pr-build-check.yaml new file mode 100644 index 0000000..35896fa --- /dev/null +++ b/.github/workflows/pr-build-check.yaml @@ -0,0 +1,41 @@ +name: PR Build Verification + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - main + - 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: 'COMMENT', + body: 'Failed To BUILD! Please check the build logs for details and Resolve the issues before merging.' + }); + }); \ No newline at end of file