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

Commit1aed9bf

Browse files
committed
CU-868g38fhz Adding in a changelog
1 parent0c3b08d commit1aed9bf

File tree

2 files changed

+73
-1
lines changed

2 files changed

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

‎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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp