Skip to content

Commit d09dc7b

Browse files
sudo-robotwilliamdes
authored andcommitted
__INIT__
0 parents  commit d09dc7b

File tree

8 files changed

+810
-0
lines changed

8 files changed

+810
-0
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.env
2+
/node_modules

LICENSE

Lines changed: 373 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Lock a pull-request
2+
3+
This action locks a pull-request
4+
5+
## Example usage
6+
7+
```yml
8+
- name: lock pull request
9+
uses: sudo-bot/action-pull-request-lock@v1
10+
with:
11+
github-token: ${{ secrets.WDES_BOT_TOKEN }}
12+
number: ${{ secrets.GITHUB_TOKEN }}
13+
lock_reason: resolved
14+
```

action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Lock pull-request"
2+
author: williamdes
3+
description: "Lock a pull-request when an event triggers the action"
4+
inputs:
5+
github-token:
6+
description: "GitHub Token"
7+
required: true
8+
number:
9+
description: "Pull Request number"
10+
required: true
11+
lock_reason:
12+
description: "The lock reason: off-topic,too heated,resolved,spam"
13+
default: "resolved"
14+
branding:
15+
icon: "git-pull-request"
16+
color: blue
17+
runs:
18+
using: "node12"
19+
main: "index.js"

index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict'
2+
3+
const core = require('@actions/core')
4+
const { GitHub, context } = require('@actions/github')
5+
6+
const main = async () => {
7+
const token = core.getInput('github-token');
8+
const lock_reason = core.getInput('lock-reason');
9+
const number = core.getInput('number');
10+
11+
const octokit = new GitHub(token);
12+
13+
await octokit.issues.lock({
14+
lock_reason: lock_reason,
15+
...context.repo,
16+
...context.owner,
17+
number: number,
18+
})
19+
}
20+
21+
main().catch(err => core.setFailed(err.message))

0 commit comments

Comments
 (0)