@@ -43,42 +43,45 @@ jobs:
43
43
if : failure() && github.event_name == 'pull_request'
44
44
with :
45
45
github-token : ${{secrets.GITHUB_TOKEN}}
46
- script : |
47
- const issue_number = context.issue.number;
48
- const owner = context.repo.owner;
49
- const repo = context.repo.repo;
46
+ script : |
47
+ const issue_number = context.issue.number;
48
+ const owner = context.repo.owner;
49
+ const repo = context.repo.repo;
50
+ const runUrl = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
50
51
51
- const commentBody = `Unable to build without Cargo.lock file.
52
+ const commentBody = `Unable to build without Cargo.lock file.
52
53
53
- This means that after this change 3rd party projects may have
54
- difficulties using crates in this repo as a dependency. If this
55
- isn't easy to fix please open an issue so we can fix it later.
54
+ This means that after this change 3rd party projects may have
55
+ difficulties using crates in this repo as a dependency. If this
56
+ isn't easy to fix please open an issue so we can fix it later.
56
57
57
- To reproduce locally run
58
+ For the failing build see: ${runUrl}
58
59
59
- \`\`\`
60
- cargo generate-lockfile
61
- cargo check --all-targets
62
- \`\`\`
60
+ To reproduce locally run
63
61
64
- This PR can still be merged.`;
62
+ \`\`\`
63
+ cargo generate-lockfile
64
+ cargo check --all-targets
65
+ \`\`\`
65
66
66
- // Fetch existing comments
67
- const { data: comments } = await github.rest.issues.listComments({
68
- owner,
69
- repo,
70
- issue_number,
71
- });
67
+ This PR can still be merged.`;
72
68
73
- // Find existing comment
74
- const existingComment = comments.find(c => c.body == commentBody);
75
- if (!existingComment) {
76
- await github.rest.issues.createComment({
69
+ // Fetch existing comments
70
+ const { data: comments } = await github.rest.issues.listComments({
77
71
owner,
78
72
repo,
79
73
issue_number,
80
- body: commentBody
81
74
});
82
- } else {
83
- console.log("Already commentted.")
84
- }
75
+
76
+ // Find existing comment
77
+ const existingComment = comments.find(c => c.body == commentBody);
78
+ if (!existingComment) {
79
+ await github.rest.issues.createComment({
80
+ owner,
81
+ repo,
82
+ issue_number,
83
+ body: commentBody
84
+ });
85
+ } else {
86
+ console.log("Already commentted.")
87
+ }
0 commit comments