generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init commit for some kind of testing
- Loading branch information
Showing
9 changed files
with
2,251 additions
and
0 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,35 @@ | ||
import { resolve, join } from 'path' | ||
import {readFileSync} from 'fs' | ||
import * as dotenv from 'dotenv' | ||
|
||
export const path = join(__dirname, '..') | ||
|
||
export interface ProcessEnv { | ||
[key: string]: string | undefined | ||
} | ||
|
||
// init environment | ||
export function initConfig(force: boolean = true, path?: string): void { | ||
if (process.env['GITHUB_REPOSITORY'] === 'trilom-test/file-changes-action' || | ||
! process.env['GITHUB_REPOSITORY']) { | ||
// path to root | ||
const realPath = path || resolve(__dirname, '..') | ||
// location of environment | ||
const envPath = resolve(realPath, ".env") | ||
// set environment | ||
dotenv.config({ path: envPath }) | ||
// reset environment to file if force | ||
if (force) resetConfig(envPath) | ||
// set path vars to current path based on env + current | ||
const envVars = ['GITHUB_EVENT_PATH', 'HOME', 'GITHUB_WORKSPACE'] | ||
envVars.forEach(s => { | ||
if (!process.env[s]?.includes(realPath)) process.env[s] = join(realPath, process.env[s] || '') | ||
}) | ||
} | ||
} | ||
async function resetConfig(path: string): Promise<void> { | ||
const envConfig = dotenv.parse(readFileSync(path)) | ||
for (const k in envConfig) { | ||
process.env[k] = envConfig[k] | ||
} | ||
} |
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,204 @@ | ||
{ | ||
"action": "created", | ||
"comment": { | ||
"author_association": "OWNER", | ||
"body": "comment", | ||
"created_at": "2020-03-05T01:48:18Z", | ||
"html_url": "https://github.com/trilom-test/file-changes-action/pull/5#issuecomment-594984510", | ||
"id": 594984510, | ||
"issue_url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/5", | ||
"node_id": "MDEyOklzc3VlQ29tbWVudDU5NDk4NDUxMA==", | ||
"updated_at": "2020-03-05T01:48:18Z", | ||
"url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/comments/594984510", | ||
"user": { | ||
"avatar_url": "https://avatars3.githubusercontent.com/u/61441570?v=4", | ||
"events_url": "https://api.github.com/users/trilom-test/events{/privacy}", | ||
"followers_url": "https://api.github.com/users/trilom-test/followers", | ||
"following_url": "https://api.github.com/users/trilom-test/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/trilom-test/gists{/gist_id}", | ||
"gravatar_id": "", | ||
"html_url": "https://github.com/trilom-test", | ||
"id": 61441570, | ||
"login": "trilom-test", | ||
"node_id": "MDQ6VXNlcjYxNDQxNTcw", | ||
"organizations_url": "https://api.github.com/users/trilom-test/orgs", | ||
"received_events_url": "https://api.github.com/users/trilom-test/received_events", | ||
"repos_url": "https://api.github.com/users/trilom-test/repos", | ||
"site_admin": false, | ||
"starred_url": "https://api.github.com/users/trilom-test/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/trilom-test/subscriptions", | ||
"type": "User", | ||
"url": "https://api.github.com/users/trilom-test" | ||
} | ||
}, | ||
"issue": { | ||
"assignee": null, | ||
"assignees": [], | ||
"author_association": "OWNER", | ||
"body": "", | ||
"closed_at": null, | ||
"comments": 1, | ||
"comments_url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/5/comments", | ||
"created_at": "2020-03-05T01:48:12Z", | ||
"events_url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/5/events", | ||
"html_url": "https://github.com/trilom-test/file-changes-action/pull/5", | ||
"id": 575936509, | ||
"labels": [], | ||
"labels_url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/5/labels{/name}", | ||
"locked": false, | ||
"milestone": null, | ||
"node_id": "MDExOlB1bGxSZXF1ZXN0Mzg0MDIyMTM5", | ||
"number": 5, | ||
"pull_request": { | ||
"diff_url": "https://github.com/trilom-test/file-changes-action/pull/5.diff", | ||
"html_url": "https://github.com/trilom-test/file-changes-action/pull/5", | ||
"patch_url": "https://github.com/trilom-test/file-changes-action/pull/5.patch", | ||
"url": "https://api.github.com/repos/trilom-test/file-changes-action/pulls/5" | ||
}, | ||
"repository_url": "https://api.github.com/repos/trilom-test/file-changes-action", | ||
"state": "open", | ||
"title": "test", | ||
"updated_at": "2020-03-05T01:48:18Z", | ||
"url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/5", | ||
"user": { | ||
"avatar_url": "https://avatars3.githubusercontent.com/u/61441570?v=4", | ||
"events_url": "https://api.github.com/users/trilom-test/events{/privacy}", | ||
"followers_url": "https://api.github.com/users/trilom-test/followers", | ||
"following_url": "https://api.github.com/users/trilom-test/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/trilom-test/gists{/gist_id}", | ||
"gravatar_id": "", | ||
"html_url": "https://github.com/trilom-test", | ||
"id": 61441570, | ||
"login": "trilom-test", | ||
"node_id": "MDQ6VXNlcjYxNDQxNTcw", | ||
"organizations_url": "https://api.github.com/users/trilom-test/orgs", | ||
"received_events_url": "https://api.github.com/users/trilom-test/received_events", | ||
"repos_url": "https://api.github.com/users/trilom-test/repos", | ||
"site_admin": false, | ||
"starred_url": "https://api.github.com/users/trilom-test/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/trilom-test/subscriptions", | ||
"type": "User", | ||
"url": "https://api.github.com/users/trilom-test" | ||
} | ||
}, | ||
"repository": { | ||
"archive_url": "https://api.github.com/repos/trilom-test/file-changes-action/{archive_format}{/ref}", | ||
"archived": false, | ||
"assignees_url": "https://api.github.com/repos/trilom-test/file-changes-action/assignees{/user}", | ||
"blobs_url": "https://api.github.com/repos/trilom-test/file-changes-action/git/blobs{/sha}", | ||
"branches_url": "https://api.github.com/repos/trilom-test/file-changes-action/branches{/branch}", | ||
"clone_url": "https://github.com/trilom-test/file-changes-action.git", | ||
"collaborators_url": "https://api.github.com/repos/trilom-test/file-changes-action/collaborators{/collaborator}", | ||
"comments_url": "https://api.github.com/repos/trilom-test/file-changes-action/comments{/number}", | ||
"commits_url": "https://api.github.com/repos/trilom-test/file-changes-action/commits{/sha}", | ||
"compare_url": "https://api.github.com/repos/trilom-test/file-changes-action/compare/{base}...{head}", | ||
"contents_url": "https://api.github.com/repos/trilom-test/file-changes-action/contents/{+path}", | ||
"contributors_url": "https://api.github.com/repos/trilom-test/file-changes-action/contributors", | ||
"created_at": "2020-02-25T04:29:40Z", | ||
"default_branch": "releases/v1", | ||
"deployments_url": "https://api.github.com/repos/trilom-test/file-changes-action/deployments", | ||
"description": "This action can be added, and you will get outputs of all of the files that have changed in your repository for you to use.", | ||
"disabled": false, | ||
"downloads_url": "https://api.github.com/repos/trilom-test/file-changes-action/downloads", | ||
"events_url": "https://api.github.com/repos/trilom-test/file-changes-action/events", | ||
"fork": true, | ||
"forks": 0, | ||
"forks_count": 0, | ||
"forks_url": "https://api.github.com/repos/trilom-test/file-changes-action/forks", | ||
"full_name": "trilom-test/file-changes-action", | ||
"git_commits_url": "https://api.github.com/repos/trilom-test/file-changes-action/git/commits{/sha}", | ||
"git_refs_url": "https://api.github.com/repos/trilom-test/file-changes-action/git/refs{/sha}", | ||
"git_tags_url": "https://api.github.com/repos/trilom-test/file-changes-action/git/tags{/sha}", | ||
"git_url": "git://github.com/trilom-test/file-changes-action.git", | ||
"has_downloads": true, | ||
"has_issues": false, | ||
"has_pages": false, | ||
"has_projects": true, | ||
"has_wiki": true, | ||
"homepage": null, | ||
"hooks_url": "https://api.github.com/repos/trilom-test/file-changes-action/hooks", | ||
"html_url": "https://github.com/trilom-test/file-changes-action", | ||
"id": 242909684, | ||
"issue_comment_url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/comments{/number}", | ||
"issue_events_url": "https://api.github.com/repos/trilom-test/file-changes-action/issues/events{/number}", | ||
"issues_url": "https://api.github.com/repos/trilom-test/file-changes-action/issues{/number}", | ||
"keys_url": "https://api.github.com/repos/trilom-test/file-changes-action/keys{/key_id}", | ||
"labels_url": "https://api.github.com/repos/trilom-test/file-changes-action/labels{/name}", | ||
"language": "JavaScript", | ||
"languages_url": "https://api.github.com/repos/trilom-test/file-changes-action/languages", | ||
"license": { | ||
"key": "mit", | ||
"name": "MIT License", | ||
"node_id": "MDc6TGljZW5zZTEz", | ||
"spdx_id": "MIT", | ||
"url": "https://api.github.com/licenses/mit" | ||
}, | ||
"merges_url": "https://api.github.com/repos/trilom-test/file-changes-action/merges", | ||
"milestones_url": "https://api.github.com/repos/trilom-test/file-changes-action/milestones{/number}", | ||
"mirror_url": null, | ||
"name": "file-changes-action", | ||
"node_id": "MDEwOlJlcG9zaXRvcnkyNDI5MDk2ODQ=", | ||
"notifications_url": "https://api.github.com/repos/trilom-test/file-changes-action/notifications{?since,all,participating}", | ||
"open_issues": 1, | ||
"open_issues_count": 1, | ||
"owner": { | ||
"avatar_url": "https://avatars3.githubusercontent.com/u/61441570?v=4", | ||
"events_url": "https://api.github.com/users/trilom-test/events{/privacy}", | ||
"followers_url": "https://api.github.com/users/trilom-test/followers", | ||
"following_url": "https://api.github.com/users/trilom-test/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/trilom-test/gists{/gist_id}", | ||
"gravatar_id": "", | ||
"html_url": "https://github.com/trilom-test", | ||
"id": 61441570, | ||
"login": "trilom-test", | ||
"node_id": "MDQ6VXNlcjYxNDQxNTcw", | ||
"organizations_url": "https://api.github.com/users/trilom-test/orgs", | ||
"received_events_url": "https://api.github.com/users/trilom-test/received_events", | ||
"repos_url": "https://api.github.com/users/trilom-test/repos", | ||
"site_admin": false, | ||
"starred_url": "https://api.github.com/users/trilom-test/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/trilom-test/subscriptions", | ||
"type": "User", | ||
"url": "https://api.github.com/users/trilom-test" | ||
}, | ||
"private": false, | ||
"pulls_url": "https://api.github.com/repos/trilom-test/file-changes-action/pulls{/number}", | ||
"pushed_at": "2020-03-05T01:48:13Z", | ||
"releases_url": "https://api.github.com/repos/trilom-test/file-changes-action/releases{/id}", | ||
"size": 29568, | ||
"ssh_url": "git@github.com:trilom-test/file-changes-action.git", | ||
"stargazers_count": 0, | ||
"stargazers_url": "https://api.github.com/repos/trilom-test/file-changes-action/stargazers", | ||
"statuses_url": "https://api.github.com/repos/trilom-test/file-changes-action/statuses/{sha}", | ||
"subscribers_url": "https://api.github.com/repos/trilom-test/file-changes-action/subscribers", | ||
"subscription_url": "https://api.github.com/repos/trilom-test/file-changes-action/subscription", | ||
"svn_url": "https://github.com/trilom-test/file-changes-action", | ||
"tags_url": "https://api.github.com/repos/trilom-test/file-changes-action/tags", | ||
"teams_url": "https://api.github.com/repos/trilom-test/file-changes-action/teams", | ||
"trees_url": "https://api.github.com/repos/trilom-test/file-changes-action/git/trees{/sha}", | ||
"updated_at": "2020-03-05T01:45:22Z", | ||
"url": "https://api.github.com/repos/trilom-test/file-changes-action", | ||
"watchers": 0, | ||
"watchers_count": 0 | ||
}, | ||
"sender": { | ||
"avatar_url": "https://avatars3.githubusercontent.com/u/61441570?v=4", | ||
"events_url": "https://api.github.com/users/trilom-test/events{/privacy}", | ||
"followers_url": "https://api.github.com/users/trilom-test/followers", | ||
"following_url": "https://api.github.com/users/trilom-test/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/trilom-test/gists{/gist_id}", | ||
"gravatar_id": "", | ||
"html_url": "https://github.com/trilom-test", | ||
"id": 61441570, | ||
"login": "trilom-test", | ||
"node_id": "MDQ6VXNlcjYxNDQxNTcw", | ||
"organizations_url": "https://api.github.com/users/trilom-test/orgs", | ||
"received_events_url": "https://api.github.com/users/trilom-test/received_events", | ||
"repos_url": "https://api.github.com/users/trilom-test/repos", | ||
"site_admin": false, | ||
"starred_url": "https://api.github.com/users/trilom-test/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/trilom-test/subscriptions", | ||
"type": "User", | ||
"url": "https://api.github.com/users/trilom-test" | ||
} | ||
} |
Oops, something went wrong.