-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Expand file tree
/
Copy pathget-commit.mjs
More file actions
42 lines (39 loc) · 953 Bytes
/
get-commit.mjs
File metadata and controls
42 lines (39 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import github from "../../github.app.mjs";
export default {
key: "github-get-commit",
name: "Get Commit",
description: "Get a commit in a GitHub repo. [See the documentation](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#get-a-commit)",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
commitSha: {
propDefinition: [
github,
"commitSha",
(c) => ({
repoFullname: c.repoFullname,
}),
],
},
},
async run({ $ }) {
const commit = await this.github.getCommit({
repoFullname: this.repoFullname,
commitRef: this.commitSha,
});
$.export("$summary", `Successfully retrieved commit ${this.commitSha}`);
return commit;
},
};