Compare commits
3 Commits
v1.0.0
...
eb4666c3df
| Author | SHA1 | Date | |
|---|---|---|---|
| eb4666c3df | |||
| def91e35d3 | |||
| 4794c6be26 |
@@ -7,11 +7,16 @@ Action bot for Github. Checks a repo's event stream and leaves a ghost comment w
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
`node . owner/repo`
|
`yarn start owner/repo`: watch the event stream and handle matches
|
||||||
|
|
||||||
|
`yarn run force owner/repo pr_number`: force a comment on a specific pr, by number
|
||||||
|
|
||||||
You'll need to set some environment flags. Check `sample-env` for what is available, and you can copy the file to `.env` in the root and add your settings there as well.
|
You'll need to set some environment flags. Check `sample-env` for what is available, and you can copy the file to `.env` in the root and add your settings there as well.
|
||||||
|
|
||||||
|
### Personal Access Token
|
||||||
|
|
||||||
|
You will need to provide a Github [Personal Access Token](https://github.com/settings/tokens/new). It will need `write:org` access in order to create comments.
|
||||||
|
|
||||||
#### License
|
#### License
|
||||||
|
|
||||||
MIT © [w33ble](https://github.com/w33ble)
|
MIT © [w33ble](https://github.com/w33ble)
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
"lint": "eslint \"*.{js,mjs}\" \"src/**/*.{js,mjs}\"",
|
"lint": "eslint \"*.{js,mjs}\" \"src/**/*.{js,mjs}\"",
|
||||||
"precommit": "lint-staged",
|
"precommit": "lint-staged",
|
||||||
"version": "auto-changelog -p && auto-authors && git add CHANGELOG.md AUTHORS.md",
|
"version": "auto-changelog -p && auto-authors && git add CHANGELOG.md AUTHORS.md",
|
||||||
"start": "node ."
|
"start": "node .",
|
||||||
|
"force": "node -r esm src/force.mjs"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
20
src/force.mjs
Normal file
20
src/force.mjs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import dotenv from 'dotenv';
|
||||||
|
import createRepo from './lib/create_repo.mjs';
|
||||||
|
import { createComment, deleteComment } from './lib/comments.mjs';
|
||||||
|
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
|
async function forceRetest() {
|
||||||
|
const [ownerRepo, prNumber] = process.argv.splice(2);
|
||||||
|
const { PULL_RETEST_BODY } = process.env;
|
||||||
|
|
||||||
|
if (!ownerRepo || !prNumber) {
|
||||||
|
throw new Error('You must specify an owner/repo combo and a pull request number');
|
||||||
|
}
|
||||||
|
|
||||||
|
const repo = createRepo(ownerRepo);
|
||||||
|
const comment = await createComment(repo, prNumber, PULL_RETEST_BODY);
|
||||||
|
await deleteComment(repo, comment.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
forceRetest().catch(err => console.error(err));
|
||||||
Reference in New Issue
Block a user