Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f606fe

Browse files
authored
Merge pull request#259 from Resgrid/develop
Develop
2 parents713677c +402f17b commit0f606fe

File tree

4 files changed

+82
-6
lines changed

4 files changed

+82
-6
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name:Sync PR to Changerawr
2+
permissions:
3+
contents:read
4+
issues:write
5+
6+
on:
7+
pull_request:
8+
types:
9+
-closed
10+
branches:
11+
-master
12+
13+
jobs:
14+
post-to-changerawr:
15+
# Only run if the PR was merged (not just closed)
16+
if:github.event.pull_request.merged == true
17+
runs-on:ubuntu-latest
18+
19+
steps:
20+
-name:Post to Changerawr API
21+
uses:actions/github-script@v7
22+
env:
23+
CHANGERAWR_API_KEY:${{ secrets.CHANGERAWR_API_KEY }}
24+
CHANGERAWR_PROJECT_ID:${{ secrets.CHANGERAWR_PROJECT_ID }}
25+
with:
26+
script:|
27+
const prBody = context.payload.pull_request.body || '';
28+
const prNumber = context.payload.pull_request.number;
29+
const prTitle = context.payload.pull_request.title;
30+
const prUrl = context.payload.pull_request.html_url;
31+
32+
// Prepare the payload for Changerawr API
33+
const payload = {
34+
notes: prBody,
35+
metadata: {
36+
pr_number: prNumber,
37+
pr_title: prTitle,
38+
pr_url: prUrl,
39+
merged_at: context.payload.pull_request.merged_at,
40+
merged_by: context.payload.pull_request.merged_by?.login || 'unknown'
41+
}
42+
};
43+
44+
try {
45+
const response = await fetch(
46+
`https://clog.resgrid.com/api/projects/${process.env.CHANGERAWR_PROJECT_ID}/changelog`,
47+
{
48+
method: 'POST',
49+
headers: {
50+
'Content-Type': 'application/json',
51+
'Authorization': `Bearer ${process.env.CHANGERAWR_API_KEY}`
52+
},
53+
body: JSON.stringify(payload)
54+
}
55+
);
56+
57+
if (!response.ok) {
58+
const errorText = await response.text();
59+
throw new Error(`Changerawr API request failed: ${response.status} - ${errorText}`);
60+
}
61+
62+
const result = await response.json();
63+
console.log('Successfully posted to Changerawr:', result);
64+
65+
// Optionally, comment on the PR with confirmation
66+
await github.rest.issues.createComment({
67+
owner: context.repo.owner,
68+
repo: context.repo.repo,
69+
issue_number: prNumber,
70+
body: '✅ Change notes have been posted to Changerawr.'
71+
});
72+
73+
} catch (error) {
74+
console.error('Error posting to Changerawr:', error);
75+
core.setFailed(`Failed to post to Changerawr: ${error.message}`);
76+
}

‎Core/Resgrid.Services/SubscriptionsService.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ public async Task<DepartmentPlanCount> GetPlanCountsForDepartmentAsync(int depar
9999
varresponse=awaitclient.ExecuteAsync<GetPlanCountsForDepartmentResult>(request);
100100

101101
if(response.StatusCode==HttpStatusCode.NotFound)
102-
returnnull;
102+
returnnewDepartmentPlanCount();
103103

104104
if(response.Data==null)
105-
returnnull;
105+
returnnewDepartmentPlanCount();
106106

107107
returnresponse.Data.Data;
108108
}

‎Repositories/Resgrid.Repositories.NoSqlRepository/MongoRepository.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
usingSystem.Threading.Tasks;
99
usingResgrid.Model;
1010
usingResgrid.Config;
11-
usingSystem.Runtime.CompilerServices;
1211
usingMongoDB.Driver.Linq;
1312

1413
namespaceResgrid.Repositories.NoSqlRepository

‎Web/Resgrid.Web.Services/Controllers/v4/MappingController.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public async Task<ActionResult<GetMapDataResult>> GetMapDataAndMarkers()
102102
varcallTypes=await_callsService.GetCallTypesForDepartmentAsync(DepartmentId);
103103

104104
varpersonnelStates=await_actionLogsService.GetLastActionLogsForDepartmentAsync(DepartmentId);
105-
varpersonnelNames=await_departmentsService.GetAllPersonnelNamesForDepartmentAsync(DepartmentId);
105+
//var personnelNames = await _departmentsService.GetAllPersonnelNamesForDepartmentAsync(DepartmentId);
106+
varpeople=await_usersService.GetUserGroupAndRolesByDepartmentIdAsync(DepartmentId,false,false,false);
106107
varpersonnelLocations=await_usersService.GetLatestLocationsForDepartmentPersonnelAsync(DepartmentId);
107108

108109
varpersonnelLocationTTL=await_departmentSettingsService.GetMappingPersonnelLocationTTLAsync(DepartmentId);
@@ -373,9 +374,9 @@ public async Task<ActionResult<GetMapDataResult>> GetMapDataAndMarkers()
373374
}
374375
}
375376

376-
if(personnelNames!=null&&personnelNames.Any())
377+
if(people!=null&&people.Any())
377378
{
378-
foreach(varpersoninpersonnelNames)
379+
foreach(varpersoninpeople)
379380
{
380381
if(!await_authorizationService.CanUserViewPersonLocationViaMatrixAsync(person.UserId,UserId,DepartmentId))
381382
continue;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp