generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from nobe4/pull-sources-via-api
Fetch sources via github's api
- Loading branch information
Showing
15 changed files
with
183 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16.15.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.0.1 | ||
v0.0.2 |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# | ||
# Remove *all* the issues from the specified repository. | ||
# | ||
# Usage : ./clear_issues.sh REPO | ||
# | ||
# REPO needs to be OWNER/NAME | ||
# | ||
# Requirements: | ||
# - `gh`: The github cli configured. | ||
# | ||
|
||
REPO="$1" | ||
[[ -z "${REPO}" ]] && echo "missing REPO argument" && exit 1 | ||
|
||
echo "Removing all the issues from ${REPO}" | ||
|
||
gh --repo "$REPO" issue list --json number --state all --limit 100 \ | ||
| jq -r '.[] | .number' \ | ||
| xargs -n1 gh --repo "$REPO" issue delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Handle interactions with Github API | ||
|
||
const github = require("@actions/github"); | ||
|
||
const self = { | ||
client: undefined, | ||
owner: undefined, | ||
repo: undefined, | ||
noop: false, | ||
|
||
setup(token, owner, repo, noop) { | ||
self.client = github.getOctokit(token); | ||
self.owner = owner; | ||
self.repo = repo; | ||
self.noop = noop; | ||
}, | ||
}; | ||
|
||
module.exports = self; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const action_github = require("@actions/github"); | ||
const github = require("../src/github.js"); | ||
|
||
describe("setup", () => { | ||
it("setup the client, owner and repo correctly", () => { | ||
jest.spyOn(action_github, "getOctokit").mockReturnValueOnce("client"); | ||
|
||
github.setup("token", "owner", "repo", true); | ||
|
||
expect(github.client).toBe("client"); | ||
expect(github.owner).toBe("owner"); | ||
expect(github.repo).toBe("repo"); | ||
expect(github.noop).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.