Skip to content

Commit

Permalink
ci: pr-validate job
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Nov 19, 2024
1 parent 337c414 commit 6cd04d3
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,6 @@ jobs:
run: |
echo "route=$(( ${{ github.event.number }} % 50 ))" >> $GITHUB_OUTPUT
- name: PR Greeting
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}
uses: bcgov-nr/action-pr-description-add@v1.1.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add_markdown: |
---
Thanks for the PR!
Any successful deployments (not always required) will be available below.
Backend: https://${{ env.PREFIX }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}/actuator/health
Frontend: https://${{ env.PREFIX }}-${{ steps.route.outputs.route }}-frontend.${{ env.DOMAIN }}
Once merged, code will be promoted and handed off to following workflow run.
[Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml)
- name: OpenShift Init
uses: bcgov-nr/action-deployer-openshift@v3.0.1
with:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR Validate

on:
pull_request:
types: [edited, opened, synchronize, reopened, ready_for_review]

concurrency:
group: ${{ github.workflow }}-edit-${{ github.event.number }}
cancel-in-progress: true

jobs:
init:
name: Initialize
outputs:
mod-tag: ${{ steps.mod-tag.outputs.mod-tag }}
runs-on: ubuntu-24.04
steps:
- name: Get PR Number Mod 50
id: mod-tag
run: echo "mod-tag=$(( ${{ github.event.number }} % 50 ))" >> $GITHUB_OUTPUT

validate:
name: Validate PR
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}
needs: [init]
uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-validate.yml@v0.8.3
with:
markdown_links: |
- [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}/actuator/health)
- [Frontend](https://${{ env.PREFIX }}-${{ steps.route.outputs.mod-tag }}-frontend.${{ env.DOMAIN }})
results:
name: Validate Results
if: always() && (!failure()) && (!cancelled())
needs: [validate]
runs-on: ubuntu-24.04
steps:
- run: echo "Success!"

0 comments on commit 6cd04d3

Please sign in to comment.