From 4d3c17e43cfae61e4af59e93e008040227400f12 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 16:40:46 +0900 Subject: [PATCH 1/8] ci: fix test --- .github/workflows/test.yaml | 14 +- action.yaml | 2 + cmd/list/main.go | 11 +- cmd/setter/main.go | 33 ++- cmd/tester/main.go | 16 +- .../branch_protection_rule/normal/data.yaml | 1 + .../branch_protection_rule/normal/envs.yaml | 9 + .../branch_protection_rule/normal/event.yaml | 157 +++++++++++++ testdata/create/normal/data.yaml | 1 + testdata/create/normal/envs.yaml | 9 + testdata/create/normal/event.yaml | 116 ++++++++++ testdata/delete/normal/event.json | 119 ++++++++++ testdata/deployment/normal/data.yaml | 1 + testdata/deployment/normal/envs.yaml | 9 + testdata/deployment/normal/event.json | 153 +++++++++++++ testdata/deployment_status/normal/data.yaml | 1 + testdata/deployment_status/normal/envs.yaml | 9 + testdata/deployment_status/normal/event.json | 186 +++++++++++++++ testdata/discussion/normal/envs.yaml | 9 + testdata/discussion/normal/event.json | 182 +++++++++++++++ testdata/discussion_comment/normal/data.yaml | 1 + testdata/discussion_comment/normal/envs.yaml | 9 + testdata/discussion_comment/normal/event.json | 215 ++++++++++++++++++ testdata/fork/normal/data.yaml | 1 + testdata/fork/normal/envs.yaml | 9 + testdata/fork/normal/event.json | 211 +++++++++++++++++ testdata/pull_request/normal.yaml | 31 --- testdata/pull_request/normal/data.yaml | 8 + testdata/pull_request/normal/envs.yaml | 12 + testdata/pull_request/normal/event.yaml | 8 + testdata/push/normal.yaml | 24 -- testdata/push/normal/data.yaml | 1 + testdata/push/normal/envs.yaml | 9 + testdata/push/normal/event.yaml | 10 + testdata/release/normal.yaml | 23 -- testdata/release/normal/data.yaml | 1 + testdata/release/normal/envs.yaml | 9 + testdata/release/normal/event.yaml | 9 + 38 files changed, 1520 insertions(+), 109 deletions(-) create mode 100644 testdata/branch_protection_rule/normal/data.yaml create mode 100644 testdata/branch_protection_rule/normal/envs.yaml create mode 100644 testdata/branch_protection_rule/normal/event.yaml create mode 100644 testdata/create/normal/data.yaml create mode 100644 testdata/create/normal/envs.yaml create mode 100644 testdata/create/normal/event.yaml create mode 100644 testdata/delete/normal/event.json create mode 100644 testdata/deployment/normal/data.yaml create mode 100644 testdata/deployment/normal/envs.yaml create mode 100644 testdata/deployment/normal/event.json create mode 100644 testdata/deployment_status/normal/data.yaml create mode 100644 testdata/deployment_status/normal/envs.yaml create mode 100644 testdata/deployment_status/normal/event.json create mode 100644 testdata/discussion/normal/envs.yaml create mode 100644 testdata/discussion/normal/event.json create mode 100644 testdata/discussion_comment/normal/data.yaml create mode 100644 testdata/discussion_comment/normal/envs.yaml create mode 100644 testdata/discussion_comment/normal/event.json create mode 100644 testdata/fork/normal/data.yaml create mode 100644 testdata/fork/normal/envs.yaml create mode 100644 testdata/fork/normal/event.json delete mode 100644 testdata/pull_request/normal.yaml create mode 100644 testdata/pull_request/normal/data.yaml create mode 100644 testdata/pull_request/normal/envs.yaml create mode 100644 testdata/pull_request/normal/event.yaml delete mode 100644 testdata/push/normal.yaml create mode 100644 testdata/push/normal/data.yaml create mode 100644 testdata/push/normal/envs.yaml create mode 100644 testdata/push/normal/event.yaml delete mode 100644 testdata/release/normal.yaml create mode 100644 testdata/release/normal/data.yaml create mode 100644 testdata/release/normal/envs.yaml create mode 100644 testdata/release/normal/event.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5c13d17..99eb8fb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,7 +10,7 @@ jobs: list-files: runs-on: ubuntu-latest outputs: - files: ${{env.FILES}} + dirs: ${{env.DIRS}} steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 @@ -21,22 +21,22 @@ jobs: test: runs-on: ubuntu-latest - name: "test (${{matrix.file}})" + name: "test (${{matrix.dir}})" needs: list-files env: - FILE: ${{matrix.file}} + DIR: ${{matrix.dir}} strategy: fail-fast: false matrix: - file: ${{fromJSON(needs.list-files.outputs.files)}} + dir: ${{fromJSON(needs.list-files.outputs.dirs)}} steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: go-version: "1.19.1" cache: true - - run: go run ./cmd/setter "$FILE" + - run: go run ./cmd/setter "$DIR" - uses: ./ with: - data: ${{toJSON(fromJSON(env.DATA).data)}} - - run: go run ./cmd/tester "$FILE" + data: ${{env.DATA}} + - run: go run ./cmd/tester "$DIR" diff --git a/action.yaml b/action.yaml index 02657dc..a820cdf 100644 --- a/action.yaml +++ b/action.yaml @@ -29,6 +29,8 @@ runs: GHA_SHA=${{fromJSON(inputs.data).event.sha}} GHA_COMMIT_STATUS_SHA=${{fromJSON(inputs.data).event.sha}} GHA_EVENT_PATH=$event_path + GHA_REF=${{fromJSON(inputs.data).event.repository.default_branch}} + GHA_REF_NAME=${{fromJSON(inputs.data).event.repository.default_branch}} EOS env: INPUTS_EVENT: ${{toJSON(fromJSON(inputs.data).event)}} diff --git a/cmd/list/main.go b/cmd/list/main.go index 477fa85..7414caa 100644 --- a/cmd/list/main.go +++ b/cmd/list/main.go @@ -15,15 +15,20 @@ func main() { } func core() error { - files, err := filepath.Glob("testdata/*/*") + envFiles, err := filepath.Glob("testdata/*/*/envs.yaml") if err != nil { return err } - b, err := json.Marshal(files) + dirs := make([]string, len(envFiles)) + for i, envFile := range envFiles { + dirs[i] = filepath.Dir(envFile) + } + + b, err := json.Marshal(dirs) if err != nil { return err } - githubactions.SetEnv("FILES", string(b)) + githubactions.SetEnv("DIRS", string(b)) return nil } diff --git a/cmd/setter/main.go b/cmd/setter/main.go index ff37154..4707fa2 100644 --- a/cmd/setter/main.go +++ b/cmd/setter/main.go @@ -4,6 +4,7 @@ import ( "encoding/json" "log" "os" + "path/filepath" "github.com/sethvargo/go-githubactions" "gopkg.in/yaml.v3" @@ -15,26 +16,36 @@ func main() { } } -type Config struct { - Envs map[string]string - Data interface{} -} - func core() error { // read config file // test envs - file := os.Args[1] - cfg := &Config{} - f, err := os.Open(file) + dir := os.Args[1] + + dataFile, err := os.Open(filepath.Join(dir, "data.yaml")) if err != nil { return err } - defer f.Close() - if err := yaml.NewDecoder(f).Decode(cfg); err != nil { + defer dataFile.Close() + data := map[string]interface{}{} + if err := yaml.NewDecoder(dataFile).Decode(&data); err != nil { + return err + } + + eventFile, err := os.Open(filepath.Join(dir, "event.yaml")) + if err != nil { + eventFile, err = os.Open(filepath.Join(dir, "event.json")) + if err != nil { + return err + } + } + defer eventFile.Close() + event := map[string]interface{}{} + if err := yaml.NewDecoder(eventFile).Decode(&event); err != nil { return err } + data["event"] = event - b, err := json.Marshal(cfg) + b, err := json.Marshal(data) if err != nil { return err } diff --git a/cmd/tester/main.go b/cmd/tester/main.go index 314ba98..acdbe5d 100644 --- a/cmd/tester/main.go +++ b/cmd/tester/main.go @@ -4,6 +4,7 @@ import ( "errors" "log" "os" + "path/filepath" "gopkg.in/yaml.v3" ) @@ -14,26 +15,21 @@ func main() { } } -type Config struct { - Envs map[string]string - Data interface{} -} - func core() error { // read config file // test envs - file := os.Args[1] - cfg := &Config{} - f, err := os.Open(file) + dir := os.Args[1] + envs := map[string]string{} + f, err := os.Open(filepath.Join(dir, "envs.yaml")) if err != nil { return err } defer f.Close() - if err := yaml.NewDecoder(f).Decode(cfg); err != nil { + if err := yaml.NewDecoder(f).Decode(&envs); err != nil { return err } failed := false - for envName, expValue := range cfg.Envs { + for envName, expValue := range envs { actValue := os.Getenv(envName) if expValue != actValue { log.Printf("[ERROR] the environment variable %s is wrong: wanted %s, got %s", envName, expValue, actValue) diff --git a/testdata/branch_protection_rule/normal/data.yaml b/testdata/branch_protection_rule/normal/data.yaml new file mode 100644 index 0000000..7c6869e --- /dev/null +++ b/testdata/branch_protection_rule/normal/data.yaml @@ -0,0 +1 @@ +event_name: branch_protection_rule diff --git a/testdata/branch_protection_rule/normal/envs.yaml b/testdata/branch_protection_rule/normal/envs.yaml new file mode 100644 index 0000000..0f35b49 --- /dev/null +++ b/testdata/branch_protection_rule/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: branch_protection_rule +GHA_REPOSITORY: octo-org/octo-repo +GHA_REPOSITORY_OWNER: octo-org +GHA_REPOSITORY_NAME: octo-repo +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: main +GHA_REF_NAME: main diff --git a/testdata/branch_protection_rule/normal/event.yaml b/testdata/branch_protection_rule/normal/event.yaml new file mode 100644 index 0000000..c080550 --- /dev/null +++ b/testdata/branch_protection_rule/normal/event.yaml @@ -0,0 +1,157 @@ +action: edited +rule: + id: 21796960 + repository_id: 259377789 + name: production + created_at: "2021-08-19T12:16:32.000-04:00" + updated_at: "2021-08-19T12:16:32.000-04:00" + pull_request_reviews_enforcement_level: "off" + required_approving_review_count: 1 + dismiss_stale_reviews_on_push: false + require_code_owner_review: false + authorized_dismissal_actors_only: false + ignore_approvals_from_contributors: false + required_status_checks: + - basic-CI + required_status_checks_enforcement_level: non_admins + strict_required_status_checks_policy: false + signature_requirement_enforcement_level: "off" + linear_history_requirement_enforcement_level: "off" + admin_enforced: false + allow_force_pushes_enforcement_level: "off" + allow_deletions_enforcement_level: "off" + merge_queue_enforcement_level: "off" + required_deployments_enforcement_level: "off" + required_conversation_resolution_level: "off" + authorized_actors_only: true + authorized_actor_names: + - Codertocat +changes: + authorized_actors_only: + from: false + authorized_actor_names: + from: [] +repository: + id: 17273051 + node_id: MDEwOlJlcG9zaXRvcnkxNzI3MzA1MQ== + name: octo-repo + full_name: octo-org/octo-repo + private: true + owner: + login: octo-org + id: 6811672 + node_id: MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI= + avatar_url: https://avatars.githubusercontent.com/u/6811672?v=4 + gravatar_id: "" + url: https://api.github.com/users/octo-org + html_url: https://github.com/octo-org + followers_url: https://api.github.com/users/octo-org/followers + following_url: https://api.github.com/users/octo-org/following{/other_user} + gists_url: https://api.github.com/users/octo-org/gists{/gist_id} + starred_url: https://api.github.com/users/octo-org/starred{/owner}{/repo} + subscriptions_url: https://api.github.com/users/octo-org/subscriptions + organizations_url: https://api.github.com/users/octo-org/orgs + repos_url: https://api.github.com/users/octo-org/repos + events_url: https://api.github.com/users/octo-org/events{/privacy} + received_events_url: https://api.github.com/users/octo-org/received_events + type: Organization + site_admin: false + html_url: https://github.com/octo-org/octo-repo + description: My first repo on GitHub! + fork: false + url: https://api.github.com/repos/octo-org/octo-repo + forks_url: https://api.github.com/repos/octo-org/octo-repo/forks + keys_url: https://api.github.com/repos/octo-org/octo-repo/keys{/key_id} + collaborators_url: https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator} + teams_url: https://api.github.com/repos/octo-org/octo-repo/teams + hooks_url: https://api.github.com/repos/octo-org/octo-repo/hooks + issue_events_url: https://api.github.com/repos/octo-org/octo-repo/issues/events{/number} + events_url: https://api.github.com/repos/octo-org/octo-repo/events + assignees_url: https://api.github.com/repos/octo-org/octo-repo/assignees{/user} + branches_url: https://api.github.com/repos/octo-org/octo-repo/branches{/branch} + tags_url: https://api.github.com/repos/octo-org/octo-repo/tags + blobs_url: https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha} + git_tags_url: https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha} + git_refs_url: https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha} + trees_url: https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha} + statuses_url: https://api.github.com/repos/octo-org/octo-repo/statuses/{sha} + languages_url: https://api.github.com/repos/octo-org/octo-repo/languages + stargazers_url: https://api.github.com/repos/octo-org/octo-repo/stargazers + contributors_url: https://api.github.com/repos/octo-org/octo-repo/contributors + subscribers_url: https://api.github.com/repos/octo-org/octo-repo/subscribers + subscription_url: https://api.github.com/repos/octo-org/octo-repo/subscription + commits_url: https://api.github.com/repos/octo-org/octo-repo/commits{/sha} + git_commits_url: https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha} + comments_url: https://api.github.com/repos/octo-org/octo-repo/comments{/number} + issue_comment_url: https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number} + contents_url: https://api.github.com/repos/octo-org/octo-repo/contents/{+path} + compare_url: https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head} + merges_url: https://api.github.com/repos/octo-org/octo-repo/merges + archive_url: https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref} + downloads_url: https://api.github.com/repos/octo-org/octo-repo/downloads + issues_url: https://api.github.com/repos/octo-org/octo-repo/issues{/number} + pulls_url: https://api.github.com/repos/octo-org/octo-repo/pulls{/number} + milestones_url: https://api.github.com/repos/octo-org/octo-repo/milestones{/number} + notifications_url: https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating} + labels_url: https://api.github.com/repos/octo-org/octo-repo/labels{/name} + releases_url: https://api.github.com/repos/octo-org/octo-repo/releases{/id} + deployments_url: https://api.github.com/repos/octo-org/octo-repo/deployments + created_at: "2014-02-28T02:42:51Z" + updated_at: "2021-03-11T14:54:13Z" + pushed_at: "2021-03-11T14:54:10Z" + git_url: git://github.com/octo-org/octo-repo.git + ssh_url: org-6811672@github.com:octo-org/octo-repo.git + clone_url: https://github.com/octo-org/octo-repo.git + svn_url: https://github.com/octo-org/octo-repo + homepage: "" + size: 300 + stargazers_count: 0 + watchers_count: 0 + language: JavaScript + has_issues: true + has_projects: false + has_downloads: true + has_wiki: false + has_pages: true + forks_count: 0 + mirror_url: null + archived: false + disabled: false + open_issues_count: 39 + license: null + forks: 0 + open_issues: 39 + watchers: 0 + default_branch: main +organization: + login: octo-org + id: 6811672 + node_id: MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI= + url: https://api.github.com/orgs/octo-org + repos_url: https://api.github.com/orgs/octo-org/repos + events_url: https://api.github.com/orgs/octo-org/events + hooks_url: https://api.github.com/orgs/octo-org/hooks + issues_url: https://api.github.com/orgs/octo-org/issues + members_url: https://api.github.com/orgs/octo-org/members{/member} + public_members_url: https://api.github.com/orgs/octo-org/public_members{/member} + avatar_url: https://avatars.githubusercontent.com/u/6811672?v=4 + description: Working better together! +sender: + login: Codertocat + id: 21031067 + node_id: MDQ6VXNlcjIxMDMxMDY3 + avatar_url: https://avatars1.githubusercontent.com/u/21031067?v=4 + gravatar_id: "" + url: https://api.github.com/users/Codertocat + html_url: https://github.com/Codertocat + followers_url: https://api.github.com/users/Codertocat/followers + following_url: https://api.github.com/users/Codertocat/following{/other_user} + gists_url: https://api.github.com/users/Codertocat/gists{/gist_id} + starred_url: https://api.github.com/users/Codertocat/starred{/owner}{/repo} + subscriptions_url: https://api.github.com/users/Codertocat/subscriptions + organizations_url: https://api.github.com/users/Codertocat/orgs + repos_url: https://api.github.com/users/Codertocat/repos + events_url: https://api.github.com/users/Codertocat/events{/privacy} + received_events_url: https://api.github.com/users/Codertocat/received_events + type: User + site_admin: false diff --git a/testdata/create/normal/data.yaml b/testdata/create/normal/data.yaml new file mode 100644 index 0000000..1abcd76 --- /dev/null +++ b/testdata/create/normal/data.yaml @@ -0,0 +1 @@ +event_name: create diff --git a/testdata/create/normal/envs.yaml b/testdata/create/normal/envs.yaml new file mode 100644 index 0000000..5cf3d36 --- /dev/null +++ b/testdata/create/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: create +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: refs/tags/simple-tag +GHA_REF_NAME: simple-tag diff --git a/testdata/create/normal/event.yaml b/testdata/create/normal/event.yaml new file mode 100644 index 0000000..9e29ff0 --- /dev/null +++ b/testdata/create/normal/event.yaml @@ -0,0 +1,116 @@ +ref: simple-tag +ref_type: tag +master_branch: master +description: null +pusher_type: user +repository: + id: 186853002 + node_id: MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI= + name: Hello-World + full_name: Codertocat/Hello-World + private: false + owner: + login: Codertocat + id: 21031067 + node_id: MDQ6VXNlcjIxMDMxMDY3 + avatar_url: https://avatars1.githubusercontent.com/u/21031067?v=4 + gravatar_id: "" + url: https://api.github.com/users/Codertocat + html_url: https://github.com/Codertocat + followers_url: https://api.github.com/users/Codertocat/followers + following_url: https://api.github.com/users/Codertocat/following{/other_user} + gists_url: https://api.github.com/users/Codertocat/gists{/gist_id} + starred_url: https://api.github.com/users/Codertocat/starred{/owner}{/repo} + subscriptions_url: https://api.github.com/users/Codertocat/subscriptions + organizations_url: https://api.github.com/users/Codertocat/orgs + repos_url: https://api.github.com/users/Codertocat/repos + events_url: https://api.github.com/users/Codertocat/events{/privacy} + received_events_url: https://api.github.com/users/Codertocat/received_events + type: User + site_admin: false + html_url: https://github.com/Codertocat/Hello-World + description: null + fork: false + url: https://api.github.com/repos/Codertocat/Hello-World + forks_url: https://api.github.com/repos/Codertocat/Hello-World/forks + keys_url: https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id} + collaborators_url: https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator} + teams_url: https://api.github.com/repos/Codertocat/Hello-World/teams + hooks_url: https://api.github.com/repos/Codertocat/Hello-World/hooks + issue_events_url: https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number} + events_url: https://api.github.com/repos/Codertocat/Hello-World/events + assignees_url: https://api.github.com/repos/Codertocat/Hello-World/assignees{/user} + branches_url: https://api.github.com/repos/Codertocat/Hello-World/branches{/branch} + tags_url: https://api.github.com/repos/Codertocat/Hello-World/tags + blobs_url: https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha} + git_tags_url: https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha} + git_refs_url: https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha} + trees_url: https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha} + statuses_url: https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha} + languages_url: https://api.github.com/repos/Codertocat/Hello-World/languages + stargazers_url: https://api.github.com/repos/Codertocat/Hello-World/stargazers + contributors_url: https://api.github.com/repos/Codertocat/Hello-World/contributors + subscribers_url: https://api.github.com/repos/Codertocat/Hello-World/subscribers + subscription_url: https://api.github.com/repos/Codertocat/Hello-World/subscription + commits_url: https://api.github.com/repos/Codertocat/Hello-World/commits{/sha} + git_commits_url: https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha} + comments_url: https://api.github.com/repos/Codertocat/Hello-World/comments{/number} + issue_comment_url: https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number} + contents_url: https://api.github.com/repos/Codertocat/Hello-World/contents/{+path} + compare_url: https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head} + merges_url: https://api.github.com/repos/Codertocat/Hello-World/merges + archive_url: https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref} + downloads_url: https://api.github.com/repos/Codertocat/Hello-World/downloads + issues_url: https://api.github.com/repos/Codertocat/Hello-World/issues{/number} + pulls_url: https://api.github.com/repos/Codertocat/Hello-World/pulls{/number} + milestones_url: https://api.github.com/repos/Codertocat/Hello-World/milestones{/number} + notifications_url: https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating} + labels_url: https://api.github.com/repos/Codertocat/Hello-World/labels{/name} + releases_url: https://api.github.com/repos/Codertocat/Hello-World/releases{/id} + deployments_url: https://api.github.com/repos/Codertocat/Hello-World/deployments + created_at: "2019-05-15T15:19:25Z" + updated_at: "2019-05-15T15:20:41Z" + pushed_at: "2019-05-15T15:20:56Z" + git_url: git://github.com/Codertocat/Hello-World.git + ssh_url: git@github.com:Codertocat/Hello-World.git + clone_url: https://github.com/Codertocat/Hello-World.git + svn_url: https://github.com/Codertocat/Hello-World + homepage: null + size: 0 + stargazers_count: 0 + watchers_count: 0 + language: Ruby + has_issues: true + has_projects: true + has_downloads: true + has_wiki: true + has_pages: true + forks_count: 1 + mirror_url: null + archived: false + disabled: false + open_issues_count: 2 + license: null + forks: 1 + open_issues: 2 + watchers: 0 + default_branch: master +sender: + login: Codertocat + id: 21031067 + node_id: MDQ6VXNlcjIxMDMxMDY3 + avatar_url: https://avatars1.githubusercontent.com/u/21031067?v=4 + gravatar_id: "" + url: https://api.github.com/users/Codertocat + html_url: https://github.com/Codertocat + followers_url: https://api.github.com/users/Codertocat/followers + following_url: https://api.github.com/users/Codertocat/following{/other_user} + gists_url: https://api.github.com/users/Codertocat/gists{/gist_id} + starred_url: https://api.github.com/users/Codertocat/starred{/owner}{/repo} + subscriptions_url: https://api.github.com/users/Codertocat/subscriptions + organizations_url: https://api.github.com/users/Codertocat/orgs + repos_url: https://api.github.com/users/Codertocat/repos + events_url: https://api.github.com/users/Codertocat/events{/privacy} + received_events_url: https://api.github.com/users/Codertocat/received_events + type: User + site_admin: false diff --git a/testdata/delete/normal/event.json b/testdata/delete/normal/event.json new file mode 100644 index 0000000..700e9dd --- /dev/null +++ b/testdata/delete/normal/event.json @@ -0,0 +1,119 @@ +{ + "ref": "simple-tag", + "ref_type": "tag", + "pusher_type": "user", + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:41Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/deployment/normal/data.yaml b/testdata/deployment/normal/data.yaml new file mode 100644 index 0000000..08f798a --- /dev/null +++ b/testdata/deployment/normal/data.yaml @@ -0,0 +1 @@ +event_name: deployment diff --git a/testdata/deployment/normal/envs.yaml b/testdata/deployment/normal/envs.yaml new file mode 100644 index 0000000..a6f147e --- /dev/null +++ b/testdata/deployment/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: deployment +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e +GHA_COMMIT_STATUS_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e +GHA_REF: master +GHA_REF_NAME: master diff --git a/testdata/deployment/normal/event.json b/testdata/deployment/normal/event.json new file mode 100644 index 0000000..ffb37ce --- /dev/null +++ b/testdata/deployment/normal/event.json @@ -0,0 +1,153 @@ +{ + "action": "created", + "deployment": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746", + "id": 145988746, + "node_id": "MDEwOkRlcGxveW1lbnQxNDU5ODg3NDY=", + "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "ref": "master", + "task": "deploy", + "payload": {}, + "original_environment": "production", + "environment": "production", + "description": null, + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-05-15T15:20:53Z", + "updated_at": "2019-05-15T15:20:53Z", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746/statuses", + "repository_url": "https://api.github.com/repos/Codertocat/Hello-World" + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:41Z", + "pushed_at": "2019-05-15T15:20:52Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/deployment_status/normal/data.yaml b/testdata/deployment_status/normal/data.yaml new file mode 100644 index 0000000..268ab8e --- /dev/null +++ b/testdata/deployment_status/normal/data.yaml @@ -0,0 +1 @@ +event_name: deployment_status diff --git a/testdata/deployment_status/normal/envs.yaml b/testdata/deployment_status/normal/envs.yaml new file mode 100644 index 0000000..a6f147e --- /dev/null +++ b/testdata/deployment_status/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: deployment +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e +GHA_COMMIT_STATUS_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e +GHA_REF: master +GHA_REF_NAME: master diff --git a/testdata/deployment_status/normal/event.json b/testdata/deployment_status/normal/event.json new file mode 100644 index 0000000..9bf07ae --- /dev/null +++ b/testdata/deployment_status/normal/event.json @@ -0,0 +1,186 @@ +{ + "action": "created", + "deployment_status": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746/statuses/209916254", + "id": 209916254, + "node_id": "MDE2OkRlcGxveW1lbnRTdGF0dXMyMDk5MTYyNTQ=", + "state": "success", + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "description": "", + "environment": "production", + "target_url": "", + "created_at": "2019-05-15T15:20:55Z", + "updated_at": "2019-05-15T15:20:55Z", + "deployment_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746", + "repository_url": "https://api.github.com/repos/Codertocat/Hello-World" + }, + "deployment": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746", + "id": 145988746, + "node_id": "MDEwOkRlcGxveW1lbnQxNDU5ODg3NDY=", + "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "ref": "master", + "task": "deploy", + "payload": {}, + "original_environment": "production", + "environment": "production", + "description": null, + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-05-15T15:20:53Z", + "updated_at": "2019-05-15T15:20:55Z", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746/statuses", + "repository_url": "https://api.github.com/repos/Codertocat/Hello-World" + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:41Z", + "pushed_at": "2019-05-15T15:20:52Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/discussion/normal/envs.yaml b/testdata/discussion/normal/envs.yaml new file mode 100644 index 0000000..5d70344 --- /dev/null +++ b/testdata/discussion/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: discussion +GHA_REPOSITORY: octo-org/octo-repo +GHA_REPOSITORY_OWNER: octo-org +GHA_REPOSITORY_NAME: octo-repo +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: main +GHA_REF_NAME: main diff --git a/testdata/discussion/normal/event.json b/testdata/discussion/normal/event.json new file mode 100644 index 0000000..d1b5628 --- /dev/null +++ b/testdata/discussion/normal/event.json @@ -0,0 +1,182 @@ +{ + "action": "created", + "discussion": { + "repository_url": "https://api.github.com/repos/octo-org/octo-repo", + "category": { + "id": 32784361, + "node_id": "DIC_kwAqGA", + "repository_id": 17273051, + "emoji": ":speech_balloon:", + "name": "General", + "description": "Chat about anything and everything here", + "created_at": "2021-03-24T12:41:54.000-05:00", + "updated_at": "2021-03-24T12:41:54.000-05:00", + "slug": "general", + "is_answerable": false + }, + "answer_html_url": null, + "answer_chosen_at": null, + "answer_chosen_by": null, + "html_url": "https://github.com/octo-org/octo-repo/discussions/90", + "id": 3297442, + "node_id": "MDEwOkRpc2N1c3Npb24zMjk3NDQy", + "number": 90, + "title": "Welcome to discussions!", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "state": "open", + "locked": false, + "comments": 0, + "created_at": "2021-03-29T14:16:08Z", + "updated_at": "2021-03-29T14:16:08Z", + "author_association": "COLLABORATOR", + "active_lock_reason": null, + "body": "We're glad to have you here!" + }, + "repository": { + "id": 17273051, + "node_id": "MDEwOlJlcG9zaXRvcnkxNzI3MzA1MQ==", + "name": "octo-repo", + "full_name": "octo-org/octo-repo", + "private": true, + "owner": { + "login": "octo-org", + "id": 6811672, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=", + "avatar_url": "https://avatars.githubusercontent.com/u/6811672?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/octo-org", + "html_url": "https://github.com/octo-org", + "followers_url": "https://api.github.com/users/octo-org/followers", + "following_url": "https://api.github.com/users/octo-org/following{/other_user}", + "gists_url": "https://api.github.com/users/octo-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octo-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octo-org/subscriptions", + "organizations_url": "https://api.github.com/users/octo-org/orgs", + "repos_url": "https://api.github.com/users/octo-org/repos", + "events_url": "https://api.github.com/users/octo-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/octo-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/octo-org/octo-repo", + "description": "My first repo on GitHub!", + "fork": false, + "url": "https://api.github.com/repos/octo-org/octo-repo", + "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks", + "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams", + "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks", + "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/octo-org/octo-repo/events", + "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags", + "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages", + "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers", + "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors", + "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers", + "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription", + "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges", + "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads", + "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}", + "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments", + "created_at": "2014-02-28T02:42:51Z", + "updated_at": "2021-03-11T14:54:13Z", + "pushed_at": "2021-03-11T14:54:10Z", + "git_url": "git://github.com/octo-org/octo-repo.git", + "ssh_url": "org-6811672@github.com:octo-org/octo-repo.git", + "clone_url": "https://github.com/octo-org/octo-repo.git", + "svn_url": "https://github.com/octo-org/octo-repo", + "homepage": "", + "size": 300, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 39, + "license": null, + "forks": 0, + "open_issues": 39, + "watchers": 0, + "default_branch": "main" + }, + "organization": { + "login": "octo-org", + "id": 6811672, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=", + "url": "https://api.github.com/orgs/octo-org", + "repos_url": "https://api.github.com/orgs/octo-org/repos", + "events_url": "https://api.github.com/orgs/octo-org/events", + "hooks_url": "https://api.github.com/orgs/octo-org/hooks", + "issues_url": "https://api.github.com/orgs/octo-org/issues", + "members_url": "https://api.github.com/orgs/octo-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/octo-org/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/6811672?v=4", + "description": "Working better together!" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/discussion_comment/normal/data.yaml b/testdata/discussion_comment/normal/data.yaml new file mode 100644 index 0000000..b672e68 --- /dev/null +++ b/testdata/discussion_comment/normal/data.yaml @@ -0,0 +1 @@ +event_name: discussion_comment diff --git a/testdata/discussion_comment/normal/envs.yaml b/testdata/discussion_comment/normal/envs.yaml new file mode 100644 index 0000000..d6e8cef --- /dev/null +++ b/testdata/discussion_comment/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: discussion_comment +GHA_REPOSITORY: octo-org/octo-repo +GHA_REPOSITORY_OWNER: octo-org +GHA_REPOSITORY_NAME: octo-repo +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: main +GHA_REF_NAME: main diff --git a/testdata/discussion_comment/normal/event.json b/testdata/discussion_comment/normal/event.json new file mode 100644 index 0000000..db2e16c --- /dev/null +++ b/testdata/discussion_comment/normal/event.json @@ -0,0 +1,215 @@ +{ + "action": "created", + "comment": { + "id": 544078, + "node_id": "MDE3OkRpc2N1c3Npb25Db21tZW50NTQ0MDc4", + "html_url": "https://github.com/octo-org/octo-repo/discussions/90#discussioncomment-544078", + "parent_id": null, + "child_comment_count": 0, + "repository_url": "octo-org/octo-repo", + "discussion_id": 3297442, + "author_association": "COLLABORATOR", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2021-03-29T14:16:31Z", + "updated_at": "2021-03-29T14:16:31Z", + "body": "I have so many questions to ask you!" + }, + "discussion": { + "repository_url": "https://api.github.com/repos/octo-org/octo-repo", + "category": { + "id": 32784361, + "node_id": "DIC_kwAqGA", + "repository_id": 17273051, + "emoji": ":speech_balloon:", + "name": "General", + "description": "Chat about anything and everything here", + "created_at": "2021-03-24T12:41:54.000-05:00", + "updated_at": "2021-03-24T12:41:54.000-05:00", + "slug": "general", + "is_answerable": false + }, + "answer_html_url": null, + "answer_chosen_at": null, + "answer_chosen_by": null, + "html_url": "https://github.com/octo-org/octo-repo/discussions/90", + "id": 3297442, + "node_id": "MDEwOkRpc2N1c3Npb24zMjk3NDQy", + "number": 90, + "title": "Welcome to discussions!", + "user": { + "login": "Codertocat", + "id": 14935376, + "node_id": "MDQ6VXNlcjE0OTM1Mzc2", + "avatar_url": "https://avatars.githubusercontent.com/u/14935376?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": true + }, + "state": "open", + "locked": false, + "comments": 1, + "created_at": "2021-03-29T14:16:08Z", + "updated_at": "2021-03-29T14:16:31Z", + "author_association": "COLLABORATOR", + "active_lock_reason": null, + "body": "We're glad to have you here!" + }, + "repository": { + "id": 17273051, + "node_id": "MDEwOlJlcG9zaXRvcnkxNzI3MzA1MQ==", + "name": "octo-repo", + "full_name": "octo-org/octo-repo", + "private": true, + "owner": { + "login": "octo-org", + "id": 6811672, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=", + "avatar_url": "https://avatars.githubusercontent.com/u/6811672?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/octo-org", + "html_url": "https://github.com/octo-org", + "followers_url": "https://api.github.com/users/octo-org/followers", + "following_url": "https://api.github.com/users/octo-org/following{/other_user}", + "gists_url": "https://api.github.com/users/octo-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octo-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octo-org/subscriptions", + "organizations_url": "https://api.github.com/users/octo-org/orgs", + "repos_url": "https://api.github.com/users/octo-org/repos", + "events_url": "https://api.github.com/users/octo-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/octo-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/octo-org/octo-repo", + "description": "My first repo on GitHub!", + "fork": false, + "url": "https://api.github.com/repos/octo-org/octo-repo", + "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks", + "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams", + "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks", + "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/octo-org/octo-repo/events", + "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags", + "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages", + "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers", + "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors", + "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers", + "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription", + "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges", + "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads", + "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}", + "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments", + "created_at": "2014-02-28T02:42:51Z", + "updated_at": "2021-03-11T14:54:13Z", + "pushed_at": "2021-03-11T14:54:10Z", + "git_url": "git://github.com/octo-org/octo-repo.git", + "ssh_url": "org-6811672@github.com:octo-org/octo-repo.git", + "clone_url": "https://github.com/octo-org/octo-repo.git", + "svn_url": "https://github.com/octo-org/octo-repo", + "homepage": "", + "size": 300, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 39, + "license": null, + "forks": 0, + "open_issues": 39, + "watchers": 0, + "default_branch": "main" + }, + "organization": { + "login": "octo-org", + "id": 6811672, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=", + "url": "https://api.github.com/orgs/octo-org", + "repos_url": "https://api.github.com/orgs/octo-org/repos", + "events_url": "https://api.github.com/orgs/octo-org/events", + "hooks_url": "https://api.github.com/orgs/octo-org/hooks", + "issues_url": "https://api.github.com/orgs/octo-org/issues", + "members_url": "https://api.github.com/orgs/octo-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/octo-org/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/6811672?v=4", + "description": "Working better together!" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/fork/normal/data.yaml b/testdata/fork/normal/data.yaml new file mode 100644 index 0000000..61c1f01 --- /dev/null +++ b/testdata/fork/normal/data.yaml @@ -0,0 +1 @@ +event_name: fork diff --git a/testdata/fork/normal/envs.yaml b/testdata/fork/normal/envs.yaml new file mode 100644 index 0000000..1e005a8 --- /dev/null +++ b/testdata/fork/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: suzuki-shunsuke +GHA_EVENT_NAME: pull_request +GHA_REPOSITORY: gha-trigger/gha-trigger +GHA_REPOSITORY_OWNER: gha-trigger +GHA_REPOSITORY_NAME: gha-trigger +GHA_SHA: 4528ea7ab7a8eef7e596097934a78eab90fb8b33 +GHA_COMMIT_STATUS_SHA: b6d8f3331c6845997b9408163a127e01fd32c120 +GHA_REF: refs/pull/149/merge +GHA_REF_NAME: 149/merge diff --git a/testdata/fork/normal/event.json b/testdata/fork/normal/event.json new file mode 100644 index 0000000..c9739bf --- /dev/null +++ b/testdata/fork/normal/event.json @@ -0,0 +1,211 @@ +{ + "forkee": { + "id": 186853261, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMyNjE=", + "name": "Hello-World", + "full_name": "Octocoders/Hello-World", + "private": false, + "owner": { + "login": "Octocoders", + "id": 38302899, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5", + "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Octocoders", + "html_url": "https://github.com/Octocoders", + "followers_url": "https://api.github.com/users/Octocoders/followers", + "following_url": "https://api.github.com/users/Octocoders/following{/other_user}", + "gists_url": "https://api.github.com/users/Octocoders/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Octocoders/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Octocoders/subscriptions", + "organizations_url": "https://api.github.com/users/Octocoders/orgs", + "repos_url": "https://api.github.com/users/Octocoders/repos", + "events_url": "https://api.github.com/users/Octocoders/events{/privacy}", + "received_events_url": "https://api.github.com/users/Octocoders/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/Octocoders/Hello-World", + "description": null, + "fork": true, + "url": "https://api.github.com/repos/Octocoders/Hello-World", + "forks_url": "https://api.github.com/repos/Octocoders/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Octocoders/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Octocoders/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Octocoders/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Octocoders/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Octocoders/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Octocoders/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Octocoders/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Octocoders/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Octocoders/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Octocoders/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Octocoders/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Octocoders/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Octocoders/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Octocoders/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Octocoders/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Octocoders/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Octocoders/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Octocoders/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Octocoders/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Octocoders/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Octocoders/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Octocoders/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Octocoders/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Octocoders/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Octocoders/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Octocoders/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Octocoders/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Octocoders/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Octocoders/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Octocoders/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Octocoders/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Octocoders/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Octocoders/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Octocoders/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Octocoders/Hello-World/deployments", + "created_at": "2019-05-15T15:20:42Z", + "updated_at": "2019-05-15T15:20:41Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Octocoders/Hello-World.git", + "ssh_url": "git@github.com:Octocoders/Hello-World.git", + "clone_url": "https://github.com/Octocoders/Hello-World.git", + "svn_url": "https://github.com/Octocoders/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "public": true + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:41Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Octocoders", + "id": 38302899, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5", + "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Octocoders", + "html_url": "https://github.com/Octocoders", + "followers_url": "https://api.github.com/users/Octocoders/followers", + "following_url": "https://api.github.com/users/Octocoders/following{/other_user}", + "gists_url": "https://api.github.com/users/Octocoders/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Octocoders/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Octocoders/subscriptions", + "organizations_url": "https://api.github.com/users/Octocoders/orgs", + "repos_url": "https://api.github.com/users/Octocoders/repos", + "events_url": "https://api.github.com/users/Octocoders/events{/privacy}", + "received_events_url": "https://api.github.com/users/Octocoders/received_events", + "type": "Organization", + "site_admin": false + } +} diff --git a/testdata/pull_request/normal.yaml b/testdata/pull_request/normal.yaml deleted file mode 100644 index 3b66f75..0000000 --- a/testdata/pull_request/normal.yaml +++ /dev/null @@ -1,31 +0,0 @@ -envs: - GHA_ACTOR: suzuki-shunsuke - GHA_EVENT_NAME: pull_request - GHA_REPOSITORY: gha-trigger/gha-trigger - GHA_REPOSITORY_OWNER: gha-trigger - GHA_REPOSITORY_NAME: gha-trigger - GHA_SHA: 4528ea7ab7a8eef7e596097934a78eab90fb8b33 - GHA_COMMIT_STATUS_SHA: b6d8f3331c6845997b9408163a127e01fd32c120 - GHA_BASE_REF: main - GHA_HEAD_SHA: b6d8f3331c6845997b9408163a127e01fd32c120 - GHA_REF: refs/pull/149/merge - GHA_REF_NAME: 149/merge - GHA_PULL_REQUEST_NUMBER: "149" -data: - event_name: pull_request - event: - number: 149 - sender: - login: suzuki-shunsuke - repository: - full_name: gha-trigger/gha-trigger - name: gha-trigger - owner: - login: gha-trigger - pull_request: - merge_commit_sha: 4528ea7ab7a8eef7e596097934a78eab90fb8b33 - base: - ref: main - head: - sha: b6d8f3331c6845997b9408163a127e01fd32c120 - ref: renovate/github.com-aws-aws-sdk-go-1.x diff --git a/testdata/pull_request/normal/data.yaml b/testdata/pull_request/normal/data.yaml new file mode 100644 index 0000000..c7a133b --- /dev/null +++ b/testdata/pull_request/normal/data.yaml @@ -0,0 +1,8 @@ +event_name: pull_request +pull_request: + merge_commit_sha: 4528ea7ab7a8eef7e596097934a78eab90fb8b33 + base: + ref: main + head: + sha: b6d8f3331c6845997b9408163a127e01fd32c120 + ref: renovate/github.com-aws-aws-sdk-go-1.x diff --git a/testdata/pull_request/normal/envs.yaml b/testdata/pull_request/normal/envs.yaml new file mode 100644 index 0000000..a288c6c --- /dev/null +++ b/testdata/pull_request/normal/envs.yaml @@ -0,0 +1,12 @@ +GHA_ACTOR: suzuki-shunsuke +GHA_EVENT_NAME: pull_request +GHA_REPOSITORY: gha-trigger/gha-trigger +GHA_REPOSITORY_OWNER: gha-trigger +GHA_REPOSITORY_NAME: gha-trigger +GHA_SHA: 4528ea7ab7a8eef7e596097934a78eab90fb8b33 +GHA_COMMIT_STATUS_SHA: b6d8f3331c6845997b9408163a127e01fd32c120 +GHA_BASE_REF: main +GHA_HEAD_SHA: b6d8f3331c6845997b9408163a127e01fd32c120 +GHA_REF: refs/pull/149/merge +GHA_REF_NAME: 149/merge +GHA_PULL_REQUEST_NUMBER: "149" diff --git a/testdata/pull_request/normal/event.yaml b/testdata/pull_request/normal/event.yaml new file mode 100644 index 0000000..93553df --- /dev/null +++ b/testdata/pull_request/normal/event.yaml @@ -0,0 +1,8 @@ +number: 149 +sender: + login: suzuki-shunsuke +repository: + full_name: gha-trigger/gha-trigger + name: gha-trigger + owner: + login: gha-trigger diff --git a/testdata/push/normal.yaml b/testdata/push/normal.yaml deleted file mode 100644 index 1b90c92..0000000 --- a/testdata/push/normal.yaml +++ /dev/null @@ -1,24 +0,0 @@ -envs: - GHA_ACTOR: suzuki-shunsuke - GHA_EVENT_NAME: push - GHA_REPOSITORY: gha-trigger/gha-trigger - GHA_REPOSITORY_OWNER: gha-trigger - GHA_REPOSITORY_NAME: gha-trigger - GHA_SHA: a705bd6d8bc3882c983477cb3f20ab74ef8c24c2 - GHA_COMMIT_STATUS_SHA: a705bd6d8bc3882c983477cb3f20ab74ef8c24c2 - GHA_REF: refs/heads/renovate/github.com-aws-aws-sdk-go-1.x - GHA_REF_NAME: renovate/github.com-aws-aws-sdk-go-1.x - -data: - event_name: push - event: - ref: refs/heads/renovate/github.com-aws-aws-sdk-go-1.x - sender: - login: suzuki-shunsuke - head_commit: - id: a705bd6d8bc3882c983477cb3f20ab74ef8c24c2 - repository: - full_name: gha-trigger/gha-trigger - name: gha-trigger - owner: - login: gha-trigger diff --git a/testdata/push/normal/data.yaml b/testdata/push/normal/data.yaml new file mode 100644 index 0000000..dc21aff --- /dev/null +++ b/testdata/push/normal/data.yaml @@ -0,0 +1 @@ +event_name: push diff --git a/testdata/push/normal/envs.yaml b/testdata/push/normal/envs.yaml new file mode 100644 index 0000000..457a36c --- /dev/null +++ b/testdata/push/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: suzuki-shunsuke +GHA_EVENT_NAME: push +GHA_REPOSITORY: gha-trigger/gha-trigger +GHA_REPOSITORY_OWNER: gha-trigger +GHA_REPOSITORY_NAME: gha-trigger +GHA_SHA: a705bd6d8bc3882c983477cb3f20ab74ef8c24c2 +GHA_COMMIT_STATUS_SHA: a705bd6d8bc3882c983477cb3f20ab74ef8c24c2 +GHA_REF: refs/heads/renovate/github.com-aws-aws-sdk-go-1.x +GHA_REF_NAME: renovate/github.com-aws-aws-sdk-go-1.x diff --git a/testdata/push/normal/event.yaml b/testdata/push/normal/event.yaml new file mode 100644 index 0000000..d50f126 --- /dev/null +++ b/testdata/push/normal/event.yaml @@ -0,0 +1,10 @@ +ref: refs/heads/renovate/github.com-aws-aws-sdk-go-1.x +sender: + login: suzuki-shunsuke +head_commit: + id: a705bd6d8bc3882c983477cb3f20ab74ef8c24c2 +repository: + full_name: gha-trigger/gha-trigger + name: gha-trigger + owner: + login: gha-trigger diff --git a/testdata/release/normal.yaml b/testdata/release/normal.yaml deleted file mode 100644 index 9f33075..0000000 --- a/testdata/release/normal.yaml +++ /dev/null @@ -1,23 +0,0 @@ -envs: - GHA_ACTOR: suzuki-shunsuke - GHA_EVENT_NAME: release - GHA_REPOSITORY: gha-trigger/gha-trigger - GHA_REPOSITORY_OWNER: gha-trigger - GHA_REPOSITORY_NAME: gha-trigger - GHA_SHA: - GHA_COMMIT_STATUS_SHA: - GHA_REF: v0.1.0 - GHA_REF_NAME: v0.1.0 - -data: - event_name: release - event: - sender: - login: suzuki-shunsuke - release: - tag_name: v0.1.0 - repository: - full_name: gha-trigger/gha-trigger - name: gha-trigger - owner: - login: gha-trigger diff --git a/testdata/release/normal/data.yaml b/testdata/release/normal/data.yaml new file mode 100644 index 0000000..c1371ec --- /dev/null +++ b/testdata/release/normal/data.yaml @@ -0,0 +1 @@ +event_name: release diff --git a/testdata/release/normal/envs.yaml b/testdata/release/normal/envs.yaml new file mode 100644 index 0000000..e06dcfc --- /dev/null +++ b/testdata/release/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: suzuki-shunsuke +GHA_EVENT_NAME: release +GHA_REPOSITORY: gha-trigger/gha-trigger +GHA_REPOSITORY_OWNER: gha-trigger +GHA_REPOSITORY_NAME: gha-trigger +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: v0.1.0 +GHA_REF_NAME: v0.1.0 diff --git a/testdata/release/normal/event.yaml b/testdata/release/normal/event.yaml new file mode 100644 index 0000000..57da2a5 --- /dev/null +++ b/testdata/release/normal/event.yaml @@ -0,0 +1,9 @@ +sender: + login: suzuki-shunsuke +release: + tag_name: v0.1.0 +repository: + full_name: gha-trigger/gha-trigger + name: gha-trigger + owner: + login: gha-trigger From 8d5f33bbc629ed6b42faf1e0457346ebf4aa4565 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 16:57:20 +0900 Subject: [PATCH 2/8] fix: fix deployment and create --- action.yaml | 18 ++++++++++++++++++ testdata/discussion/normal/data.yaml | 1 + testdata/fork/normal/envs.yaml | 18 +++++++++--------- 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 testdata/discussion/normal/data.yaml diff --git a/action.yaml b/action.yaml index a820cdf..092f332 100644 --- a/action.yaml +++ b/action.yaml @@ -101,6 +101,24 @@ runs: EOS if: "env.GHA_EVENT_NAME == 'push' && startsWith(env.GHA_REF, 'refs/tags/')" + - shell: bash + run: | + cat << EOS >> "$GITHUB_ENV" + GHA_REF=${{fromJSON(inputs.data).event.ref}} + GHA_REF_NAME=${{fromJSON(inputs.data).event.ref}} + EOS + if: env.GHA_EVENT_NAME == 'create' + + - shell: bash + run: | + cat << EOS >> "$GITHUB_ENV" + GHA_SHA=${{fromJSON(inputs.data).event.deployment.sha}} + GHA_COMMIT_STATUS_SHA=${{fromJSON(inputs.data).event.deployment.sha}} + GHA_REF=${{fromJSON(inputs.data).event.deployment.ref}} + GHA_REF_NAME=${{fromJSON(inputs.data).event.deployment.ref}} + EOS + if: env.GHA_EVENT_NAME == 'deployment' || env.GHA_EVENT_NAME == 'deployment_status' + # TODO GITHUB_REF # > The branch or tag ref that triggered the workflow run. # > For other triggers, this is the branch or tag ref that triggered the workflow run. diff --git a/testdata/discussion/normal/data.yaml b/testdata/discussion/normal/data.yaml new file mode 100644 index 0000000..91a1f81 --- /dev/null +++ b/testdata/discussion/normal/data.yaml @@ -0,0 +1 @@ +event_name: discussion diff --git a/testdata/fork/normal/envs.yaml b/testdata/fork/normal/envs.yaml index 1e005a8..5345d5d 100644 --- a/testdata/fork/normal/envs.yaml +++ b/testdata/fork/normal/envs.yaml @@ -1,9 +1,9 @@ -GHA_ACTOR: suzuki-shunsuke -GHA_EVENT_NAME: pull_request -GHA_REPOSITORY: gha-trigger/gha-trigger -GHA_REPOSITORY_OWNER: gha-trigger -GHA_REPOSITORY_NAME: gha-trigger -GHA_SHA: 4528ea7ab7a8eef7e596097934a78eab90fb8b33 -GHA_COMMIT_STATUS_SHA: b6d8f3331c6845997b9408163a127e01fd32c120 -GHA_REF: refs/pull/149/merge -GHA_REF_NAME: 149/merge +GHA_ACTOR: Octocoders +GHA_EVENT_NAME: fork +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: master +GHA_REF_NAME: master From 056228c236f71488fcbc4c5ad2439facdaf429e8 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 17:10:51 +0900 Subject: [PATCH 3/8] fix: fix create GHA_REF --- action.yaml | 15 ++++++++++++++- testdata/deployment_status/normal/envs.yaml | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 092f332..c6bb20a 100644 --- a/action.yaml +++ b/action.yaml @@ -104,11 +104,24 @@ runs: - shell: bash run: | cat << EOS >> "$GITHUB_ENV" - GHA_REF=${{fromJSON(inputs.data).event.ref}} GHA_REF_NAME=${{fromJSON(inputs.data).event.ref}} EOS if: env.GHA_EVENT_NAME == 'create' + - shell: bash + run: | + cat << EOS >> "$GITHUB_ENV" + GHA_REF=refs/heads/${{fromJSON(inputs.data).event.ref}} + EOS + if: "env.GHA_EVENT_NAME == 'create' && fromJSON(inputs.data).event.ref_type == 'branch'" + + - shell: bash + run: | + cat << EOS >> "$GITHUB_ENV" + GHA_REF=refs/tags/${{fromJSON(inputs.data).event.ref}} + EOS + if: "env.GHA_EVENT_NAME == 'create' && fromJSON(inputs.data).event.ref_type == 'tag'" + - shell: bash run: | cat << EOS >> "$GITHUB_ENV" diff --git a/testdata/deployment_status/normal/envs.yaml b/testdata/deployment_status/normal/envs.yaml index a6f147e..f339a97 100644 --- a/testdata/deployment_status/normal/envs.yaml +++ b/testdata/deployment_status/normal/envs.yaml @@ -1,5 +1,5 @@ GHA_ACTOR: Codertocat -GHA_EVENT_NAME: deployment +GHA_EVENT_NAME: deployment_status GHA_REPOSITORY: Codertocat/Hello-World GHA_REPOSITORY_OWNER: Codertocat GHA_REPOSITORY_NAME: Hello-World From 3e0d1b1d73b4b0a6abbfd85d1d49bb3f54fb6322 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 18:45:08 +0900 Subject: [PATCH 4/8] fix: fix GHA_REF --- action.yaml | 4 ++-- testdata/branch_protection_rule/normal/envs.yaml | 2 +- testdata/deployment/normal/envs.yaml | 2 +- testdata/deployment_status/normal/envs.yaml | 2 +- testdata/fork/normal/envs.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yaml b/action.yaml index c6bb20a..f888e1b 100644 --- a/action.yaml +++ b/action.yaml @@ -29,7 +29,7 @@ runs: GHA_SHA=${{fromJSON(inputs.data).event.sha}} GHA_COMMIT_STATUS_SHA=${{fromJSON(inputs.data).event.sha}} GHA_EVENT_PATH=$event_path - GHA_REF=${{fromJSON(inputs.data).event.repository.default_branch}} + GHA_REF=refs/heads/${{fromJSON(inputs.data).event.repository.default_branch}} GHA_REF_NAME=${{fromJSON(inputs.data).event.repository.default_branch}} EOS env: @@ -66,7 +66,7 @@ runs: # > For workflows triggered by release, this is the release tag created. run: | cat << EOS >> "$GITHUB_ENV" - GHA_REF=${{fromJSON(inputs.data).event.release.tag_name}} + GHA_REF=refs/tags/${{fromJSON(inputs.data).event.release.tag_name}} GHA_REF_NAME=${{fromJSON(inputs.data).event.release.tag_name}} EOS if: env.GHA_EVENT_NAME == 'release' diff --git a/testdata/branch_protection_rule/normal/envs.yaml b/testdata/branch_protection_rule/normal/envs.yaml index 0f35b49..8ed4ef9 100644 --- a/testdata/branch_protection_rule/normal/envs.yaml +++ b/testdata/branch_protection_rule/normal/envs.yaml @@ -5,5 +5,5 @@ GHA_REPOSITORY_OWNER: octo-org GHA_REPOSITORY_NAME: octo-repo GHA_SHA: GHA_COMMIT_STATUS_SHA: -GHA_REF: main +GHA_REF: refs/heads/main GHA_REF_NAME: main diff --git a/testdata/deployment/normal/envs.yaml b/testdata/deployment/normal/envs.yaml index a6f147e..acbf069 100644 --- a/testdata/deployment/normal/envs.yaml +++ b/testdata/deployment/normal/envs.yaml @@ -5,5 +5,5 @@ GHA_REPOSITORY_OWNER: Codertocat GHA_REPOSITORY_NAME: Hello-World GHA_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e GHA_COMMIT_STATUS_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e -GHA_REF: master +GHA_REF: refs/heads/master GHA_REF_NAME: master diff --git a/testdata/deployment_status/normal/envs.yaml b/testdata/deployment_status/normal/envs.yaml index f339a97..28d749f 100644 --- a/testdata/deployment_status/normal/envs.yaml +++ b/testdata/deployment_status/normal/envs.yaml @@ -5,5 +5,5 @@ GHA_REPOSITORY_OWNER: Codertocat GHA_REPOSITORY_NAME: Hello-World GHA_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e GHA_COMMIT_STATUS_SHA: f95f852bd8fca8fcc58a9a2d6c842781e32a215e -GHA_REF: master +GHA_REF: refs/heads/master GHA_REF_NAME: master diff --git a/testdata/fork/normal/envs.yaml b/testdata/fork/normal/envs.yaml index 5345d5d..72ad934 100644 --- a/testdata/fork/normal/envs.yaml +++ b/testdata/fork/normal/envs.yaml @@ -5,5 +5,5 @@ GHA_REPOSITORY_OWNER: Codertocat GHA_REPOSITORY_NAME: Hello-World GHA_SHA: GHA_COMMIT_STATUS_SHA: -GHA_REF: master +GHA_REF: refs/heads/master GHA_REF_NAME: master From 6f005d93b005ad4a6194c5c58fd28e30b58b9f83 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 18:48:43 +0900 Subject: [PATCH 5/8] fix: fix --- action.yaml | 3 ++- testdata/discussion/normal/envs.yaml | 2 +- testdata/discussion_comment/normal/envs.yaml | 2 +- testdata/release/normal/envs.yaml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/action.yaml b/action.yaml index f888e1b..25c6235 100644 --- a/action.yaml +++ b/action.yaml @@ -124,10 +124,11 @@ runs: - shell: bash run: | + # TODO GITHUB_REF: Branch or tag to be deployed (empty if created with a commit SHA) cat << EOS >> "$GITHUB_ENV" GHA_SHA=${{fromJSON(inputs.data).event.deployment.sha}} GHA_COMMIT_STATUS_SHA=${{fromJSON(inputs.data).event.deployment.sha}} - GHA_REF=${{fromJSON(inputs.data).event.deployment.ref}} + GHA_REF=refs/heads/${{fromJSON(inputs.data).event.deployment.ref}} GHA_REF_NAME=${{fromJSON(inputs.data).event.deployment.ref}} EOS if: env.GHA_EVENT_NAME == 'deployment' || env.GHA_EVENT_NAME == 'deployment_status' diff --git a/testdata/discussion/normal/envs.yaml b/testdata/discussion/normal/envs.yaml index 5d70344..8d8f614 100644 --- a/testdata/discussion/normal/envs.yaml +++ b/testdata/discussion/normal/envs.yaml @@ -5,5 +5,5 @@ GHA_REPOSITORY_OWNER: octo-org GHA_REPOSITORY_NAME: octo-repo GHA_SHA: GHA_COMMIT_STATUS_SHA: -GHA_REF: main +GHA_REF: refs/heads/main GHA_REF_NAME: main diff --git a/testdata/discussion_comment/normal/envs.yaml b/testdata/discussion_comment/normal/envs.yaml index d6e8cef..5619b69 100644 --- a/testdata/discussion_comment/normal/envs.yaml +++ b/testdata/discussion_comment/normal/envs.yaml @@ -5,5 +5,5 @@ GHA_REPOSITORY_OWNER: octo-org GHA_REPOSITORY_NAME: octo-repo GHA_SHA: GHA_COMMIT_STATUS_SHA: -GHA_REF: main +GHA_REF: refs/heads/main GHA_REF_NAME: main diff --git a/testdata/release/normal/envs.yaml b/testdata/release/normal/envs.yaml index e06dcfc..eaa226e 100644 --- a/testdata/release/normal/envs.yaml +++ b/testdata/release/normal/envs.yaml @@ -5,5 +5,5 @@ GHA_REPOSITORY_OWNER: gha-trigger GHA_REPOSITORY_NAME: gha-trigger GHA_SHA: GHA_COMMIT_STATUS_SHA: -GHA_REF: v0.1.0 +GHA_REF: refs/tags/v0.1.0 GHA_REF_NAME: v0.1.0 From 30753e7849bd8754cc64a718f2f2babe498ca858 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 19:10:30 +0900 Subject: [PATCH 6/8] ci: add test data --- testdata/delete/normal/data.yaml | 1 + testdata/delete/normal/envs.yaml | 9 + testdata/gollum/normal/data.yaml | 1 + testdata/gollum/normal/envs.yaml | 9 + testdata/gollum/normal/event.json | 126 +++++ testdata/issue_comment/normal/data.yaml | 1 + testdata/issue_comment/normal/envs.yaml | 9 + testdata/issue_comment/normal/event.json | 277 ++++++++++ testdata/issues/normal/data.yaml | 1 + testdata/issues/normal/envs.yaml | 9 + testdata/issues/normal/event.json | 247 +++++++++ testdata/label/normal/data.yaml | 1 + testdata/label/normal/envs.yaml | 9 + testdata/label/normal/event.json | 125 +++++ testdata/milestone/normal/envs.yaml | 9 + testdata/milestone/normal/event.json | 154 ++++++ testdata/project/normal/event.json | 151 ++++++ testdata/project_card/normal/event.json | 149 ++++++ testdata/project_column/normal/event.json | 127 +++++ testdata/public/normal/event.json | 116 +++++ .../pull_request_review/normal/event.json | 479 +++++++++++++++++ .../normal/event.json | 489 ++++++++++++++++++ testdata/status/normal/event.json | 224 ++++++++ 23 files changed, 2723 insertions(+) create mode 100644 testdata/delete/normal/data.yaml create mode 100644 testdata/delete/normal/envs.yaml create mode 100644 testdata/gollum/normal/data.yaml create mode 100644 testdata/gollum/normal/envs.yaml create mode 100644 testdata/gollum/normal/event.json create mode 100644 testdata/issue_comment/normal/data.yaml create mode 100644 testdata/issue_comment/normal/envs.yaml create mode 100644 testdata/issue_comment/normal/event.json create mode 100644 testdata/issues/normal/data.yaml create mode 100644 testdata/issues/normal/envs.yaml create mode 100644 testdata/issues/normal/event.json create mode 100644 testdata/label/normal/data.yaml create mode 100644 testdata/label/normal/envs.yaml create mode 100644 testdata/label/normal/event.json create mode 100644 testdata/milestone/normal/envs.yaml create mode 100644 testdata/milestone/normal/event.json create mode 100644 testdata/project/normal/event.json create mode 100644 testdata/project_card/normal/event.json create mode 100644 testdata/project_column/normal/event.json create mode 100644 testdata/public/normal/event.json create mode 100644 testdata/pull_request_review/normal/event.json create mode 100644 testdata/pull_request_review_comment/normal/event.json create mode 100644 testdata/status/normal/event.json diff --git a/testdata/delete/normal/data.yaml b/testdata/delete/normal/data.yaml new file mode 100644 index 0000000..a959416 --- /dev/null +++ b/testdata/delete/normal/data.yaml @@ -0,0 +1 @@ +event_name: delete diff --git a/testdata/delete/normal/envs.yaml b/testdata/delete/normal/envs.yaml new file mode 100644 index 0000000..c5d340b --- /dev/null +++ b/testdata/delete/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: delete +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: refs/tags/simple-tag +GHA_REF_NAME: simple-tag diff --git a/testdata/gollum/normal/data.yaml b/testdata/gollum/normal/data.yaml new file mode 100644 index 0000000..f2ed9ab --- /dev/null +++ b/testdata/gollum/normal/data.yaml @@ -0,0 +1 @@ +event_name: gollum diff --git a/testdata/gollum/normal/envs.yaml b/testdata/gollum/normal/envs.yaml new file mode 100644 index 0000000..43b2f1e --- /dev/null +++ b/testdata/gollum/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: rachmari +GHA_EVENT_NAME: gollum +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: refs/heads/master +GHA_REF_NAME: master diff --git a/testdata/gollum/normal/event.json b/testdata/gollum/normal/event.json new file mode 100644 index 0000000..cc04966 --- /dev/null +++ b/testdata/gollum/normal/event.json @@ -0,0 +1,126 @@ +{ + "pages": [ + { + "page_name": "Home", + "title": "Home", + "summary": null, + "action": "edited", + "sha": "6bf911d3801dd1ef957fc6ade5a8d96429e7fa39", + "html_url": "https://github.com/Codertocat/Hello-World/wiki/Home" + } + ], + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:19:27Z", + "pushed_at": "2019-05-15T15:19:26Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "rachmari", + "id": 9831992, + "node_id": "MDQ6VXNlcjk4MzE5OTI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/9831992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rachmari", + "html_url": "https://github.com/rachmari", + "followers_url": "https://api.github.com/users/rachmari/followers", + "following_url": "https://api.github.com/users/rachmari/following{/other_user}", + "gists_url": "https://api.github.com/users/rachmari/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rachmari/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rachmari/subscriptions", + "organizations_url": "https://api.github.com/users/rachmari/orgs", + "repos_url": "https://api.github.com/users/rachmari/repos", + "events_url": "https://api.github.com/users/rachmari/events{/privacy}", + "received_events_url": "https://api.github.com/users/rachmari/received_events", + "type": "User", + "site_admin": true + } +} diff --git a/testdata/issue_comment/normal/data.yaml b/testdata/issue_comment/normal/data.yaml new file mode 100644 index 0000000..a7b01f7 --- /dev/null +++ b/testdata/issue_comment/normal/data.yaml @@ -0,0 +1 @@ +event_name: issue_comment diff --git a/testdata/issue_comment/normal/envs.yaml b/testdata/issue_comment/normal/envs.yaml new file mode 100644 index 0000000..328ba37 --- /dev/null +++ b/testdata/issue_comment/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: issue_comment +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: refs/heads/master +GHA_REF_NAME: master diff --git a/testdata/issue_comment/normal/event.json b/testdata/issue_comment/normal/event.json new file mode 100644 index 0000000..be55c3e --- /dev/null +++ b/testdata/issue_comment/normal/event.json @@ -0,0 +1,277 @@ +{ + "action": "created", + "issue": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1", + "repository_url": "https://api.github.com/repos/Codertocat/Hello-World", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/labels{/name}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/events", + "html_url": "https://github.com/Codertocat/Hello-World/issues/1", + "id": 444500041, + "node_id": "MDU6SXNzdWU0NDQ1MDAwNDE=", + "number": 1, + "title": "Spelling error in the README file", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "id": 1362934389, + "node_id": "MDU6TGFiZWwxMzYyOTM0Mzg5", + "url": "https://api.github.com/repos/Codertocat/Hello-World/labels/bug", + "name": "bug", + "color": "d73a4a", + "default": true + } + ], + "state": "open", + "locked": false, + "assignee": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "assignees": [ + { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } + ], + "milestone": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1", + "html_url": "https://github.com/Codertocat/Hello-World/milestone/1", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1/labels", + "id": 4317517, + "node_id": "MDk6TWlsZXN0b25lNDMxNzUxNw==", + "number": 1, + "title": "v1.0", + "description": "Add new space flight simulator", + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 1, + "closed_issues": 0, + "state": "closed", + "created_at": "2019-05-15T15:20:17Z", + "updated_at": "2019-05-15T15:20:18Z", + "due_on": "2019-05-23T07:00:00Z", + "closed_at": "2019-05-15T15:20:18Z" + }, + "comments": 0, + "created_at": "2019-05-15T15:20:18Z", + "updated_at": "2019-05-15T15:20:21Z", + "closed_at": null, + "author_association": "OWNER", + "body": "It looks like you accidently spelled 'commit' with two 't's." + }, + "comment": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments/492700400", + "html_url": "https://github.com/Codertocat/Hello-World/issues/1#issuecomment-492700400", + "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1", + "id": 492700400, + "node_id": "MDEyOklzc3VlQ29tbWVudDQ5MjcwMDQwMA==", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-05-15T15:20:21Z", + "updated_at": "2019-05-15T15:20:21Z", + "author_association": "OWNER", + "body": "You are totally right! I'll get this fixed right away." + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:19:27Z", + "pushed_at": "2019-05-15T15:20:13Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": null, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/issues/normal/data.yaml b/testdata/issues/normal/data.yaml new file mode 100644 index 0000000..0876ba8 --- /dev/null +++ b/testdata/issues/normal/data.yaml @@ -0,0 +1 @@ +event_name: issues diff --git a/testdata/issues/normal/envs.yaml b/testdata/issues/normal/envs.yaml new file mode 100644 index 0000000..79a15c0 --- /dev/null +++ b/testdata/issues/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: issues +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: refs/heads/master +GHA_REF_NAME: master diff --git a/testdata/issues/normal/event.json b/testdata/issues/normal/event.json new file mode 100644 index 0000000..b4cdc81 --- /dev/null +++ b/testdata/issues/normal/event.json @@ -0,0 +1,247 @@ +{ + "action": "edited", + "issue": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1", + "repository_url": "https://api.github.com/repos/Codertocat/Hello-World", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/labels{/name}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/events", + "html_url": "https://github.com/Codertocat/Hello-World/issues/1", + "id": 444500041, + "node_id": "MDU6SXNzdWU0NDQ1MDAwNDE=", + "number": 1, + "title": "Spelling error in the README file", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "id": 1362934389, + "node_id": "MDU6TGFiZWwxMzYyOTM0Mzg5", + "url": "https://api.github.com/repos/Codertocat/Hello-World/labels/bug", + "name": "bug", + "color": "d73a4a", + "default": true + } + ], + "state": "open", + "locked": false, + "assignee": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "assignees": [ + { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } + ], + "milestone": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1", + "html_url": "https://github.com/Codertocat/Hello-World/milestone/1", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1/labels", + "id": 4317517, + "node_id": "MDk6TWlsZXN0b25lNDMxNzUxNw==", + "number": 1, + "title": "v1.0", + "description": "Add new space flight simulator", + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 1, + "closed_issues": 0, + "state": "closed", + "created_at": "2019-05-15T15:20:17Z", + "updated_at": "2019-05-15T15:20:18Z", + "due_on": "2019-05-23T07:00:00Z", + "closed_at": "2019-05-15T15:20:18Z" + }, + "comments": 0, + "created_at": "2019-05-15T15:20:18Z", + "updated_at": "2019-05-15T15:20:18Z", + "closed_at": null, + "author_association": "OWNER", + "body": "It looks like you accidently spelled 'commit' with two 't's." + }, + "changes": {}, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:19:27Z", + "pushed_at": "2019-05-15T15:20:13Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": null, + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/label/normal/data.yaml b/testdata/label/normal/data.yaml new file mode 100644 index 0000000..1092681 --- /dev/null +++ b/testdata/label/normal/data.yaml @@ -0,0 +1 @@ +event_name: label diff --git a/testdata/label/normal/envs.yaml b/testdata/label/normal/envs.yaml new file mode 100644 index 0000000..baa5f00 --- /dev/null +++ b/testdata/label/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: label +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: refs/heads/master +GHA_REF_NAME: master diff --git a/testdata/label/normal/event.json b/testdata/label/normal/event.json new file mode 100644 index 0000000..aa01f8d --- /dev/null +++ b/testdata/label/normal/event.json @@ -0,0 +1,125 @@ +{ + "action": "deleted", + "label": { + "id": 1362937026, + "node_id": "MDU6TGFiZWwxMzYyOTM3MDI2", + "url": "https://api.github.com/repos/Codertocat/Hello-World/labels/:bug:%20Bugfix", + "name": ":bug: Bugfix", + "color": "cceeaa", + "default": false + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:21:03Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/milestone/normal/envs.yaml b/testdata/milestone/normal/envs.yaml new file mode 100644 index 0000000..931336b --- /dev/null +++ b/testdata/milestone/normal/envs.yaml @@ -0,0 +1,9 @@ +GHA_ACTOR: Codertocat +GHA_EVENT_NAME: milestone +GHA_REPOSITORY: Codertocat/Hello-World +GHA_REPOSITORY_OWNER: Codertocat +GHA_REPOSITORY_NAME: Hello-World +GHA_SHA: +GHA_COMMIT_STATUS_SHA: +GHA_REF: refs/heads/master +GHA_REF_NAME: master diff --git a/testdata/milestone/normal/event.json b/testdata/milestone/normal/event.json new file mode 100644 index 0000000..c4e15bc --- /dev/null +++ b/testdata/milestone/normal/event.json @@ -0,0 +1,154 @@ +{ + "action": "created", + "milestone": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1", + "html_url": "https://github.com/Codertocat/Hello-World/milestone/1", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1/labels", + "id": 4317517, + "node_id": "MDk6TWlsZXN0b25lNDMxNzUxNw==", + "number": 1, + "title": "v1.0", + "description": "Add new space flight simulator", + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "open_issues": 0, + "closed_issues": 0, + "state": "open", + "created_at": "2019-05-15T15:20:17Z", + "updated_at": "2019-05-15T15:20:17Z", + "due_on": "2019-05-23T07:00:00Z", + "closed_at": null + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:19:27Z", + "pushed_at": "2019-05-15T15:20:13Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/project/normal/event.json b/testdata/project/normal/event.json new file mode 100644 index 0000000..a25b490 --- /dev/null +++ b/testdata/project/normal/event.json @@ -0,0 +1,151 @@ +{ + "action": "created", + "project": { + "owner_url": "https://api.github.com/repos/Codertocat/Hello-World", + "url": "https://api.github.com/projects/2640902", + "html_url": "https://github.com/Codertocat/Hello-World/projects/1", + "columns_url": "https://api.github.com/projects/2640902/columns", + "id": 2640902, + "node_id": "MDc6UHJvamVjdDI2NDA5MDI=", + "name": "Space 2.0", + "body": "Project tasks for a trip to Space", + "number": 1, + "state": "open", + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-05-15T15:21:06Z", + "updated_at": "2019-05-15T15:21:06Z" + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:21:03Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/project_card/normal/event.json b/testdata/project_card/normal/event.json new file mode 100644 index 0000000..0ab39d9 --- /dev/null +++ b/testdata/project_card/normal/event.json @@ -0,0 +1,149 @@ +{ + "action": "created", + "project_card": { + "url": "https://api.github.com/projects/columns/cards/21567453", + "project_url": "https://api.github.com/projects/2640902", + "column_url": "https://api.github.com/projects/columns/5368157", + "column_id": 5368157, + "id": 21567453, + "node_id": "MDExOlByb2plY3RDYXJkMjE1Njc0NTM=", + "note": "Work that can be completed in one hour or less.", + "archived": false, + "creator": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-05-15T15:21:10Z", + "updated_at": "2019-05-15T15:21:10Z" + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:21:03Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/project_column/normal/event.json b/testdata/project_column/normal/event.json new file mode 100644 index 0000000..813b062 --- /dev/null +++ b/testdata/project_column/normal/event.json @@ -0,0 +1,127 @@ +{ + "action": "created", + "project_column": { + "url": "https://api.github.com/projects/columns/5368157", + "project_url": "https://api.github.com/projects/2640902", + "cards_url": "https://api.github.com/projects/columns/5368157/cards", + "id": 5368157, + "node_id": "MDEzOlByb2plY3RDb2x1bW41MzY4MTU3", + "name": "Small bugfixes", + "created_at": "2019-05-15T15:21:09Z", + "updated_at": "2019-05-15T15:21:09Z" + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:21:03Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/public/normal/event.json b/testdata/public/normal/event.json new file mode 100644 index 0000000..fbee5cf --- /dev/null +++ b/testdata/public/normal/event.json @@ -0,0 +1,116 @@ +{ + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:21:03Z", + "pushed_at": "2019-05-15T15:20:57Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/pull_request_review/normal/event.json b/testdata/pull_request_review/normal/event.json new file mode 100644 index 0000000..ea08c24 --- /dev/null +++ b/testdata/pull_request_review/normal/event.json @@ -0,0 +1,479 @@ +{ + "action": "submitted", + "review": { + "id": 237895671, + "node_id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3MjM3ODk1Njcx", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "body": null, + "commit_id": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "submitted_at": "2019-05-15T15:20:38Z", + "state": "commented", + "html_url": "https://github.com/Codertocat/Hello-World/pull/2#pullrequestreview-237895671", + "pull_request_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2", + "author_association": "OWNER", + "_links": { + "html": { + "href": "https://github.com/Codertocat/Hello-World/pull/2#pullrequestreview-237895671" + }, + "pull_request": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2" + } + } + }, + "pull_request": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2", + "id": 279147437, + "node_id": "MDExOlB1bGxSZXF1ZXN0Mjc5MTQ3NDM3", + "html_url": "https://github.com/Codertocat/Hello-World/pull/2", + "diff_url": "https://github.com/Codertocat/Hello-World/pull/2.diff", + "patch_url": "https://github.com/Codertocat/Hello-World/pull/2.patch", + "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", + "number": 2, + "state": "open", + "locked": false, + "title": "Update the README with new information.", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2019-05-15T15:20:33Z", + "updated_at": "2019-05-15T15:20:38Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "c4295bd74fb0f4fda03689c3df3f2803b658fd85", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits", + "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments", + "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "head": { + "label": "Codertocat:changes", + "ref": "changes", + "sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:34Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false + } + }, + "base": { + "label": "Codertocat:master", + "ref": "master", + "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:34Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2" + }, + "html": { + "href": "https://github.com/Codertocat/Hello-World/pull/2" + }, + "issue": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2" + }, + "comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821" + } + }, + "author_association": "OWNER" + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:34Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/pull_request_review_comment/normal/event.json b/testdata/pull_request_review_comment/normal/event.json new file mode 100644 index 0000000..8fa9404 --- /dev/null +++ b/testdata/pull_request_review_comment/normal/event.json @@ -0,0 +1,489 @@ +{ + "action": "created", + "comment": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments/284312630", + "pull_request_review_id": 237895671, + "id": 284312630, + "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NDMxMjYzMA==", + "diff_hunk": "@@ -1 +1 @@\n-# Hello-World", + "path": "README.md", + "position": 1, + "original_position": 1, + "commit_id": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "original_commit_id": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "body": "Maybe you should use more emoji on this line.", + "created_at": "2019-05-15T15:20:37Z", + "updated_at": "2019-05-15T15:20:38Z", + "html_url": "https://github.com/Codertocat/Hello-World/pull/2#discussion_r284312630", + "pull_request_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2", + "author_association": "OWNER", + "_links": { + "self": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments/284312630" + }, + "html": { + "href": "https://github.com/Codertocat/Hello-World/pull/2#discussion_r284312630" + }, + "pull_request": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2" + } + } + }, + "pull_request": { + "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2", + "id": 279147437, + "node_id": "MDExOlB1bGxSZXF1ZXN0Mjc5MTQ3NDM3", + "html_url": "https://github.com/Codertocat/Hello-World/pull/2", + "diff_url": "https://github.com/Codertocat/Hello-World/pull/2.diff", + "patch_url": "https://github.com/Codertocat/Hello-World/pull/2.patch", + "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", + "number": 2, + "state": "open", + "locked": false, + "title": "Update the README with new information.", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "body": "This is a pretty simple change that we need to pull into master.", + "created_at": "2019-05-15T15:20:33Z", + "updated_at": "2019-05-15T15:20:38Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "c4295bd74fb0f4fda03689c3df3f2803b658fd85", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits", + "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments", + "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "head": { + "label": "Codertocat:changes", + "ref": "changes", + "sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:34Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false + } + }, + "base": { + "label": "Codertocat:master", + "ref": "master", + "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "user": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:34Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2" + }, + "html": { + "href": "https://github.com/Codertocat/Hello-World/pull/2" + }, + "issue": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2" + }, + "comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/2/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/ec26c3e57ca3a959ca5aad62de7213c562f8c821" + } + }, + "author_association": "OWNER" + }, + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:34Z", + "pushed_at": "2019-05-15T15:20:33Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 0, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/testdata/status/normal/event.json b/testdata/status/normal/event.json new file mode 100644 index 0000000..659719a --- /dev/null +++ b/testdata/status/normal/event.json @@ -0,0 +1,224 @@ +{ + "id": 6805126730, + "sha": "6113728f27ae82c7b1a177c8d03f9e96e0adf246", + "name": "Codertocat/Hello-World", + "target_url": null, + "context": "default", + "description": null, + "state": "success", + "commit": { + "sha": "6113728f27ae82c7b1a177c8d03f9e96e0adf246", + "node_id": "MDY6Q29tbWl0MTg2ODUzMDAyOjYxMTM3MjhmMjdhZTgyYzdiMWExNzdjOGQwM2Y5ZTk2ZTBhZGYyNDY=", + "commit": { + "author": { + "name": "Codertocat", + "email": "21031067+Codertocat@users.noreply.github.com", + "date": "2019-05-15T15:19:25Z" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2019-05-15T15:19:25Z" + }, + "message": "Initial commit", + "tree": { + "sha": "1b13fc88733f95cc8cb16170f6990ef30d78acf4", + "url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees/1b13fc88733f95cc8cb16170f6990ef30d78acf4" + }, + "url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits/6113728f27ae82c7b1a177c8d03f9e96e0adf246", + "comment_count": 1, + "verification": { + "verified": true, + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJc3C39CRBK7hj4Ov3rIwAAdHIIABvaC0PQWgtUDQ5cz8ISR/Gf\npQYSuDMeeRa90wXzafPYowzID+UNU2eaRD4ak1bhb7kYVsZnPhUt5jTLKzr4Zuq8\nvt9ucrUvLDQWUZe2jX4wipM8ykWIlDho+9OAoocbVAn0kPBZEqJK74fH0Uj8vUfw\nIX71oq7XYsd2iGi9iMrYczr3aTe4EyQoYj/R+aAuRlLwU5LVciuyl0AmxMQXJ+qn\nowTpROWvXb1HijQZgx2x1lAEBzvahOiayOsJ+ZZ1DZX1lpXaSoeAjth1t2ckHlWW\n907fehmtX2cfccfrTLJC55QdhWU305ZtUoNRTp7TrdUecXnQcWKFcMmE/Yx1vps=\n=LQlK\n-----END PGP SIGNATURE-----\n", + "payload": "tree 1b13fc88733f95cc8cb16170f6990ef30d78acf4\nauthor Codertocat <21031067+Codertocat@users.noreply.github.com> 1557933565 -0500\ncommitter GitHub 1557933565 -0500\n\nInitial commit" + } + }, + "url": "https://api.github.com/repos/Codertocat/Hello-World/commits/6113728f27ae82c7b1a177c8d03f9e96e0adf246", + "html_url": "https://github.com/Codertocat/Hello-World/commit/6113728f27ae82c7b1a177c8d03f9e96e0adf246", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/commits/6113728f27ae82c7b1a177c8d03f9e96e0adf246/comments", + "author": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "web-flow", + "id": 19864447, + "node_id": "MDQ6VXNlcjE5ODY0NDQ3", + "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/web-flow", + "html_url": "https://github.com/web-flow", + "followers_url": "https://api.github.com/users/web-flow/followers", + "following_url": "https://api.github.com/users/web-flow/following{/other_user}", + "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", + "organizations_url": "https://api.github.com/users/web-flow/orgs", + "repos_url": "https://api.github.com/users/web-flow/repos", + "events_url": "https://api.github.com/users/web-flow/events{/privacy}", + "received_events_url": "https://api.github.com/users/web-flow/received_events", + "type": "User", + "site_admin": false + }, + "parents": [] + }, + "branches": [ + { + "name": "master", + "commit": { + "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "url": "https://api.github.com/repos/Codertocat/Hello-World/commits/f95f852bd8fca8fcc58a9a2d6c842781e32a215e" + }, + "protected": false + }, + { + "name": "changes", + "commit": { + "sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "url": "https://api.github.com/repos/Codertocat/Hello-World/commits/ec26c3e57ca3a959ca5aad62de7213c562f8c821" + }, + "protected": false + }, + { + "name": "gh-pages", + "commit": { + "sha": "507fc9acd0d04ac4a9db87d12cb228c052cd813a", + "url": "https://api.github.com/repos/Codertocat/Hello-World/commits/507fc9acd0d04ac4a9db87d12cb228c052cd813a" + }, + "protected": false + } + ], + "created_at": "2019-05-15T15:20:55+00:00", + "updated_at": "2019-05-15T15:20:55+00:00", + "repository": { + "id": 186853002, + "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", + "name": "Hello-World", + "full_name": "Codertocat/Hello-World", + "private": false, + "owner": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/Codertocat/Hello-World", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/Codertocat/Hello-World", + "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", + "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", + "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", + "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", + "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", + "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", + "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", + "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", + "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", + "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", + "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", + "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", + "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", + "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", + "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", + "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", + "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", + "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", + "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", + "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", + "created_at": "2019-05-15T15:19:25Z", + "updated_at": "2019-05-15T15:20:41Z", + "pushed_at": "2019-05-15T15:20:52Z", + "git_url": "git://github.com/Codertocat/Hello-World.git", + "ssh_url": "git@github.com:Codertocat/Hello-World.git", + "clone_url": "https://github.com/Codertocat/Hello-World.git", + "svn_url": "https://github.com/Codertocat/Hello-World", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Ruby", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 2, + "license": null, + "forks": 1, + "open_issues": 2, + "watchers": 0, + "default_branch": "master" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} From f827490f39f7096d303c6a2ff898ee772231761a Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 19:11:16 +0900 Subject: [PATCH 7/8] ci: remove workflows --- .github/workflows/actionlint.yaml | 16 -------------- .github/workflows/prettier.yaml | 14 ------------ .../workflows/renovate-config-validator.yaml | 22 ------------------- aqua.yaml | 8 ------- 4 files changed, 60 deletions(-) delete mode 100644 .github/workflows/actionlint.yaml delete mode 100644 .github/workflows/prettier.yaml delete mode 100644 .github/workflows/renovate-config-validator.yaml delete mode 100644 aqua.yaml diff --git a/.github/workflows/actionlint.yaml b/.github/workflows/actionlint.yaml deleted file mode 100644 index cf63593..0000000 --- a/.github/workflows/actionlint.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: actionlint -on: - push: - branches: [main] - pull_request: - branches: [main] -jobs: - default: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: aquaproj/aqua-installer@v1.1.2 - with: - aqua_version: v1.19.2 - - run: actionlint diff --git a/.github/workflows/prettier.yaml b/.github/workflows/prettier.yaml deleted file mode 100644 index 2a0464b..0000000 --- a/.github/workflows/prettier.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: prettier -on: - push: - branches: [main] - pull_request: - branches: [main] -jobs: - prettier: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: npm i -g prettier - - run: prettier -c . diff --git a/.github/workflows/renovate-config-validator.yaml b/.github/workflows/renovate-config-validator.yaml deleted file mode 100644 index 3e33595..0000000 --- a/.github/workflows/renovate-config-validator.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: renovate-config-validator - -on: - pull_request: - branches: - - main - paths: - - .github/workflows/renovate-config-validator.yaml - - renovate.json - push: - branches: - - main - paths: - - .github/workflows/renovate-config-validator.yaml - - renovate.json - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: suzuki-shunsuke/github-action-renovate-config-validator@v0.1.2 diff --git a/aqua.yaml b/aqua.yaml deleted file mode 100644 index c3069c3..0000000 --- a/aqua.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# aqua - Declarative CLI Version Manager -# https://aquaproj.github.io/ -registries: - - type: standard - ref: v3.59.0 # renovate: depName=aquaproj/aqua-registry -packages: - - name: rhysd/actionlint@v1.6.19 From 3b4e18ba48056fd0e69f7abb90a68a1fe8aa81a2 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 19:14:38 +0900 Subject: [PATCH 8/8] fix: fix delete --- action.yaml | 8 +++++--- testdata/milestone/normal/data.yaml | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 testdata/milestone/normal/data.yaml diff --git a/action.yaml b/action.yaml index 25c6235..a60d49f 100644 --- a/action.yaml +++ b/action.yaml @@ -106,21 +106,23 @@ runs: cat << EOS >> "$GITHUB_ENV" GHA_REF_NAME=${{fromJSON(inputs.data).event.ref}} EOS - if: env.GHA_EVENT_NAME == 'create' + if: contains(fromJSON('["create", "delete"]'), env.GHA_EVENT_NAME) - shell: bash run: | cat << EOS >> "$GITHUB_ENV" GHA_REF=refs/heads/${{fromJSON(inputs.data).event.ref}} EOS - if: "env.GHA_EVENT_NAME == 'create' && fromJSON(inputs.data).event.ref_type == 'branch'" + if: | + contains(fromJSON('["create", "delete"]'), env.GHA_EVENT_NAME) && fromJSON(inputs.data).event.ref_type == 'branch' - shell: bash run: | cat << EOS >> "$GITHUB_ENV" GHA_REF=refs/tags/${{fromJSON(inputs.data).event.ref}} EOS - if: "env.GHA_EVENT_NAME == 'create' && fromJSON(inputs.data).event.ref_type == 'tag'" + if: | + contains(fromJSON('["create", "delete"]'), env.GHA_EVENT_NAME) && fromJSON(inputs.data).event.ref_type == 'tag' - shell: bash run: | diff --git a/testdata/milestone/normal/data.yaml b/testdata/milestone/normal/data.yaml new file mode 100644 index 0000000..cf6691c --- /dev/null +++ b/testdata/milestone/normal/data.yaml @@ -0,0 +1 @@ +event_name: milestone