-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into NDT-458-Wrong-line-number-for-GIS-import
- Loading branch information
Showing
19 changed files
with
306 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Detect Merge Conflict | ||
|
||
on: | ||
pull_request_target: | ||
types: [edited, synchronize] | ||
|
||
jobs: | ||
move-to-merge-conflict: | ||
environment: | ||
name: development | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Does PR have conflic | ||
env: | ||
HEAD_REF: ${{ github.event.pull_request.head.ref }} | ||
id: check_conflict | ||
run: | | ||
git config user.name "CCBC Service Account" | ||
git config user.email "116113628+ccbc-service-account@users.noreply.github.com" | ||
git fetch origin | ||
git checkout main | ||
git pull origin main | ||
git checkout "$HEAD_REF" | ||
git pull origin "$HEAD_REF" | ||
set -e | ||
git merge main --no-commit --no-ff | ||
MERGE_STATUS=$? | ||
echo $MERGE_STATUS | ||
echo "MERGE_STATUS=$MERGE_STATUS" >> $GITHUB_OUTPUT | ||
- name: Save PR number | ||
if: steps.check_conflict.outputs.MERGE_STATUS != 0 | ||
env: | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
run: | | ||
mkdir -p ./pr | ||
echo $PR_NUMBER > ./pr/pr_number | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: pr_number | ||
path: pr/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Move Merge Conflict Tickets | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['Detect Merge Conflict'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
get-feature-name: | ||
environment: | ||
name: development | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Artifact | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const { owner, repo } = context.repo | ||
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner, | ||
repo, | ||
run_id: context.payload.workflow_run.id | ||
}) | ||
const matchArtifact = allArtifacts.data.filter(artifact => artifact.name === 'feature-name')[0] | ||
const download = await github.rest.actions.downloadArtifact({ | ||
owner, | ||
repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip' | ||
}) | ||
const fs = require('fs') | ||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data)) | ||
- run: unzip pr_number.zip | ||
- name: Check PR details and get feature name | ||
id: get_feature_name | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
result-encoding: string | ||
script: | | ||
const fs = require('fs') | ||
const prNumber = Number(fs.readFileSync('pr/pr_number')) | ||
const pr = await github.rest.pulls.get({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: prNumber | ||
}) | ||
if (pr.head.repo.fork){ | ||
return | ||
} | ||
const featureName = pr.head.ref | ||
const regex = /NDT-\d+/g; | ||
const match = featureName.match(regex) | ||
return match | ||
- name: Check Status of issue | ||
if: startsWith(steps.get_feature_name.outputs.result, 'NDT-') | ||
id: get_status | ||
run: | | ||
response=$(curl -s -X GET \ | ||
-H "Authorization: Basic ${{ secrets.JIRA_AUTH }}" \ | ||
-H "Content-Type: application/json" \ | ||
"https://connectivitydivision.atlassian.net/rest/api/3/issue/${{ steps.get_feature_name.outputs.result }}") | ||
echo "Jira Key: $JIRA_KEY" | ||
echo "Response: $response" | ||
status=$(echo "$response" | jq -r '.fields.status.name') | ||
echo "Issue status: $status" | ||
echo "::set-output name=status::$status" | ||
- name: Move to Merge Conflict Column | ||
if: steps.get_status.outputs.status == 'PO REVIEW' | ||
run: | | ||
curl -X POST \ | ||
-H "Authorization: Basic ${{ secrets.JIRA_AUTH }}" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"transition": { | ||
"id": "9" | ||
} | ||
}' \ | ||
"https://connectivitydivision.atlassian.net/rest/api/3/issue/$JIRA_KEY/transitions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 2 additions & 13 deletions
15
app/backend/lib/emails/templates/assesmentSecondReviewChange.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.