diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 166746c09..4ffa70a2f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,3 +1,6 @@ +# *.fsx,*.fs: formatting F# files using fantomless +df5cfb143c4efe73806ead91e5cddf4e133be0a8 + # commitlint.config: split helper funcs and plugins 3008d6578aa484ae776b29c9246dca4eeae3418a diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 28af6800c..a10888e78 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,99 +3,8 @@ name: CI on: [push, pull_request] jobs: - build: - name: Build - runs-on: ubuntu-22.04 - container: - image: "ubuntu:22.04" - steps: - - uses: actions/checkout@v2 - - name: Install required dependencies - run: | - apt update - apt install -y sudo - sudo apt install -y git - # workaround for https://github.com/actions/runner/issues/2033 - - name: ownership workaround - run: git config --global --add safe.directory '*' - - name: Install dotnet sdk - run: sudo apt install -y dotnet6 - - name: Compile the conventions solution - run: dotnet build --configuration Release conventions.sln - - name: Compile F# scripts - run: dotnet fsi scripts/compileFSharpScripts.fsx - - file-conventions-tests: - name: Run FileConventions-lib unit tests - needs: build - runs-on: ubuntu-22.04 - container: - image: "ubuntu:22.04" - steps: - - uses: actions/checkout@v2 - - name: Install required dependencies - run: | - apt update - apt install --yes sudo - - # We need to install curl otherwise we get these errors in the CI: - # Unable to load the service index for source https://api.nuget.org/v3/index.json. - # The SSL connection could not be established, see inner exception. - # The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot - sudo apt install --yes curl - - - name: Setup .NET - run: apt install -y dotnet6 - - name: Run tests to validate F# scripts - run: dotnet test src/FileConventions.Test/FileConventions.Test.fsproj - - commitlint-plugins-tests: - name: Run commitlint-related tests - needs: build - runs-on: ubuntu-22.04 - container: - image: "ubuntu:22.04" - steps: - - uses: actions/checkout@v2 - - name: Install required dependencies - run: | - apt update - apt install --yes sudo - sudo apt install --yes git - - sudo apt install --yes curl - # can't install ubuntu's default nodejs version because we would get this error: - # error @jest/core@29.4.1: The engine "node" is incompatible with this module. Expected version "^14.15.0 || ^16.10.0 || >=18.0.0". Got "12.22.9" - curl --show-error --location https://deb.nodesource.com/setup_14.x | sudo --preserve-env bash - - sudo DEBIAN_FRONTEND=noninteractive apt install --yes nodejs - - name: Print versions - run: | - git --version - node --version - npm --version - npx commitlint --version - - name: Install yarn - run: | - npm install --global yarn - yarn add --dev jest typescript ts-jest @types/jest - - name: Install commitlint - run: | - npm install conventional-changelog-conventionalcommits - npm install commitlint@latest - - name: Print versions - run: | - git --version - node --version - npm --version - npx commitlint --version - - name: Run tests to validate our plugins - run: yarn jest - sanity-check: name: Sanity check - needs: - - file-conventions-tests - - commitlint-plugins-tests runs-on: ubuntu-22.04 container: image: "ubuntu:22.04" @@ -105,6 +14,8 @@ jobs: apt update && apt install --yes sudo sudo apt install --yes git sudo DEBIAN_FRONTEND=noninteractive apt install --yes npm + - name: Install dotnet sdk + run: sudo apt install -y dotnet6 - uses: actions/checkout@v2 with: submodules: recursive @@ -113,57 +24,15 @@ jobs: # workaround for https://github.com/actions/runner/issues/2033 - name: ownership workaround run: git config --global --add safe.directory '*' - - name: Print versions - run: | - git --version - node --version - npm --version - - name: Validate current commit (last commit) with commitlint - if: github.event_name == 'push' - run: ./commitlint.sh --from HEAD~1 --to HEAD --verbose - - name: Validate PR commits with commitlint - if: github.event_name == 'pull_request' - run: | - ./commitlint.sh --verbose \ - --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \ - --to ${{ github.event.pull_request.head.sha }} - - name: Install dotnet sdk - run: sudo apt install --yes dotnet6 - - name: Check all files end with EOL - run: dotnet fsi scripts/eofConvention.fsx - - name: Check all .fsx scripts have shebang - run: dotnet fsi scripts/shebangConvention.fsx - - name: Check there are no mixed line-endings in any files - run: dotnet fsi scripts/mixedLineEndings.fsx - - name: Check there are no unpinned GitHubActions image versions - run: dotnet fsi scripts/unpinnedGitHubActionsImageVersions.fsx - - name: Check there are no unpinned dotnet package versions - run: dotnet fsi scripts/unpinnedDotnetPackageVersions.fsx - - name: Check there are no unpinned nuget package reference versions in F# scripts - run: dotnet fsi scripts/unpinnedNugetPackageReferenceVersions.fsx - name: Check if gitPush1by1 was used if: github.event_name == 'pull_request' run: dotnet fsi scripts/detectNotUsingGitPush1by1.fsx - - name: Install prettier - run: npm install prettier@2.8.3 - - name: Change file permissions - # We need this step so we can change the files using `npx prettier --write` in the next step. - # Otherwise we get permission denied error in the CI. - run: sudo chmod 777 -R . - - name: Run "prettier" to check the style of our TypeScript code - run: | - sudo npx prettier --quote-props=consistent --write './**/*.ts' - # Since we changed file modes in the previous step we need the following command to - # make git ignore mode changes in files and doesn't include them in the git diff command. - git config core.fileMode false - # Since after installing commitlint dependencies package.json file changes, we need to - # run the following command to ignore package.json file - git restore package.json - git diff --exit-code + - name: Run test 10 + if: github.event_name == 'pull_request' + run: dotnet fsi test10.fsx - name: fantomless run: | dotnet new tool-manifest dotnet tool install fantomless-tool --version 4.7.997-prerelease dotnet fantomless --recurse . git diff --exit-code - diff --git a/scripts/checkSuitsType.json b/scripts/checkSuitsType.json new file mode 100644 index 000000000..09c1f9dae --- /dev/null +++ b/scripts/checkSuitsType.json @@ -0,0 +1,377 @@ +{ + "total_count": 2, + "check_suites": [ + { + "id": 11157990057, + "node_id": "CS_kwDOIMpMhM8AAAACmRFqqQ", + "head_branch": "fSharpScriptsWithoutShebang-squashed2", + "head_sha": "86140764e7f95649a70f117067146d4a6b7c8201", + "status": "completed", + "conclusion": "success", + "url": "https://api.github.com/repos/realmarv/conventions/check-suites/11157990057", + "before": "b0d38475ff2e95f8f424c98a85efd39658d5ff15", + "after": "86140764e7f95649a70f117067146d4a6b7c8201", + "pull_requests": [ + + ], + "app": { + "id": 15368, + "slug": "github-actions", + "node_id": "MDM6QXBwMTUzNjg=", + "owner": { + "login": "github", + "id": 9919, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", + "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github", + "html_url": "https://github.com/github", + "followers_url": "https://api.github.com/users/github/followers", + "following_url": "https://api.github.com/users/github/following{/other_user}", + "gists_url": "https://api.github.com/users/github/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github/subscriptions", + "organizations_url": "https://api.github.com/users/github/orgs", + "repos_url": "https://api.github.com/users/github/repos", + "events_url": "https://api.github.com/users/github/events{/privacy}", + "received_events_url": "https://api.github.com/users/github/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GitHub Actions", + "description": "Automate your workflow from idea to production", + "external_url": "https://help.github.com/en/actions", + "html_url": "https://github.com/apps/github-actions", + "created_at": "2018-07-30T09:30:17Z", + "updated_at": "2019-12-10T19:04:12Z", + "permissions": { + "actions": "write", + "administration": "read", + "checks": "write", + "contents": "write", + "deployments": "write", + "discussions": "write", + "issues": "write", + "merge_queues": "write", + "metadata": "read", + "packages": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "security_events": "write", + "statuses": "write", + "vulnerability_alerts": "read" + }, + "events": [ + "branch_protection_rule", + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "merge_group", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "status", + "watch", + "workflow_dispatch", + "workflow_run" + ] + }, + "created_at": "2023-02-23T12:10:48Z", + "updated_at": "2023-02-23T12:16:40Z", + "rerequestable": true, + "runs_rerequestable": false, + "latest_check_runs_count": 3, + "check_runs_url": "https://api.github.com/repos/realmarv/conventions/check-suites/11157990057/check-runs", + "head_commit": { + "id": "86140764e7f95649a70f117067146d4a6b7c8201", + "tree_id": "381222317743d7ccb6ae59ca9d4079c9f7ef882c", + "message": "FileConventions: add HasCorrectShebang function", + "timestamp": "2023-02-23T12:02:15Z", + "author": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + }, + "committer": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + } + }, + "repository": { + "id": 550128772, + "node_id": "R_kgDOIMpMhA", + "name": "conventions", + "full_name": "realmarv/conventions", + "private": false, + "owner": { + "login": "realmarv", + "id": 50144546, + "node_id": "MDQ6VXNlcjUwMTQ0NTQ2", + "avatar_url": "https://avatars.githubusercontent.com/u/50144546?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/realmarv", + "html_url": "https://github.com/realmarv", + "followers_url": "https://api.github.com/users/realmarv/followers", + "following_url": "https://api.github.com/users/realmarv/following{/other_user}", + "gists_url": "https://api.github.com/users/realmarv/gists{/gist_id}", + "starred_url": "https://api.github.com/users/realmarv/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/realmarv/subscriptions", + "organizations_url": "https://api.github.com/users/realmarv/orgs", + "repos_url": "https://api.github.com/users/realmarv/repos", + "events_url": "https://api.github.com/users/realmarv/events{/privacy}", + "received_events_url": "https://api.github.com/users/realmarv/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/realmarv/conventions", + "description": null, + "fork": true, + "url": "https://api.github.com/repos/realmarv/conventions", + "forks_url": "https://api.github.com/repos/realmarv/conventions/forks", + "keys_url": "https://api.github.com/repos/realmarv/conventions/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/realmarv/conventions/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/realmarv/conventions/teams", + "hooks_url": "https://api.github.com/repos/realmarv/conventions/hooks", + "issue_events_url": "https://api.github.com/repos/realmarv/conventions/issues/events{/number}", + "events_url": "https://api.github.com/repos/realmarv/conventions/events", + "assignees_url": "https://api.github.com/repos/realmarv/conventions/assignees{/user}", + "branches_url": "https://api.github.com/repos/realmarv/conventions/branches{/branch}", + "tags_url": "https://api.github.com/repos/realmarv/conventions/tags", + "blobs_url": "https://api.github.com/repos/realmarv/conventions/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/realmarv/conventions/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/realmarv/conventions/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/realmarv/conventions/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/realmarv/conventions/statuses/{sha}", + "languages_url": "https://api.github.com/repos/realmarv/conventions/languages", + "stargazers_url": "https://api.github.com/repos/realmarv/conventions/stargazers", + "contributors_url": "https://api.github.com/repos/realmarv/conventions/contributors", + "subscribers_url": "https://api.github.com/repos/realmarv/conventions/subscribers", + "subscription_url": "https://api.github.com/repos/realmarv/conventions/subscription", + "commits_url": "https://api.github.com/repos/realmarv/conventions/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/realmarv/conventions/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/realmarv/conventions/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/realmarv/conventions/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/realmarv/conventions/contents/{+path}", + "compare_url": "https://api.github.com/repos/realmarv/conventions/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/realmarv/conventions/merges", + "archive_url": "https://api.github.com/repos/realmarv/conventions/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/realmarv/conventions/downloads", + "issues_url": "https://api.github.com/repos/realmarv/conventions/issues{/number}", + "pulls_url": "https://api.github.com/repos/realmarv/conventions/pulls{/number}", + "milestones_url": "https://api.github.com/repos/realmarv/conventions/milestones{/number}", + "notifications_url": "https://api.github.com/repos/realmarv/conventions/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/realmarv/conventions/labels{/name}", + "releases_url": "https://api.github.com/repos/realmarv/conventions/releases{/id}", + "deployments_url": "https://api.github.com/repos/realmarv/conventions/deployments" + } + }, + { + "id": 11158210887, + "node_id": "CS_kwDOIMpMhM8AAAACmRTJRw", + "head_branch": "fSharpScriptsWithoutShebang-squashed2", + "head_sha": "86140764e7f95649a70f117067146d4a6b7c8201", + "status": "completed", + "conclusion": "success", + "url": "https://api.github.com/repos/realmarv/conventions/check-suites/11158210887", + "before": "b0d38475ff2e95f8f424c98a85efd39658d5ff15", + "after": "86140764e7f95649a70f117067146d4a6b7c8201", + "pull_requests": [ + + ], + "app": { + "id": 15368, + "slug": "github-actions", + "node_id": "MDM6QXBwMTUzNjg=", + "owner": { + "login": "github", + "id": 9919, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", + "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github", + "html_url": "https://github.com/github", + "followers_url": "https://api.github.com/users/github/followers", + "following_url": "https://api.github.com/users/github/following{/other_user}", + "gists_url": "https://api.github.com/users/github/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github/subscriptions", + "organizations_url": "https://api.github.com/users/github/orgs", + "repos_url": "https://api.github.com/users/github/repos", + "events_url": "https://api.github.com/users/github/events{/privacy}", + "received_events_url": "https://api.github.com/users/github/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GitHub Actions", + "description": "Automate your workflow from idea to production", + "external_url": "https://help.github.com/en/actions", + "html_url": "https://github.com/apps/github-actions", + "created_at": "2018-07-30T09:30:17Z", + "updated_at": "2019-12-10T19:04:12Z", + "permissions": { + "actions": "write", + "administration": "read", + "checks": "write", + "contents": "write", + "deployments": "write", + "discussions": "write", + "issues": "write", + "merge_queues": "write", + "metadata": "read", + "packages": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "security_events": "write", + "statuses": "write", + "vulnerability_alerts": "read" + }, + "events": [ + "branch_protection_rule", + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "merge_group", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "status", + "watch", + "workflow_dispatch", + "workflow_run" + ] + }, + "created_at": "2023-02-23T12:21:33Z", + "updated_at": "2023-02-23T12:26:13Z", + "rerequestable": true, + "runs_rerequestable": false, + "latest_check_runs_count": 3, + "check_runs_url": "https://api.github.com/repos/realmarv/conventions/check-suites/11158210887/check-runs", + "head_commit": { + "id": "86140764e7f95649a70f117067146d4a6b7c8201", + "tree_id": "381222317743d7ccb6ae59ca9d4079c9f7ef882c", + "message": "FileConventions: add HasCorrectShebang function", + "timestamp": "2023-02-23T12:02:15Z", + "author": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + }, + "committer": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + } + }, + "repository": { + "id": 550128772, + "node_id": "R_kgDOIMpMhA", + "name": "conventions", + "full_name": "realmarv/conventions", + "private": false, + "owner": { + "login": "realmarv", + "id": 50144546, + "node_id": "MDQ6VXNlcjUwMTQ0NTQ2", + "avatar_url": "https://avatars.githubusercontent.com/u/50144546?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/realmarv", + "html_url": "https://github.com/realmarv", + "followers_url": "https://api.github.com/users/realmarv/followers", + "following_url": "https://api.github.com/users/realmarv/following{/other_user}", + "gists_url": "https://api.github.com/users/realmarv/gists{/gist_id}", + "starred_url": "https://api.github.com/users/realmarv/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/realmarv/subscriptions", + "organizations_url": "https://api.github.com/users/realmarv/orgs", + "repos_url": "https://api.github.com/users/realmarv/repos", + "events_url": "https://api.github.com/users/realmarv/events{/privacy}", + "received_events_url": "https://api.github.com/users/realmarv/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/realmarv/conventions", + "description": null, + "fork": true, + "url": "https://api.github.com/repos/realmarv/conventions", + "forks_url": "https://api.github.com/repos/realmarv/conventions/forks", + "keys_url": "https://api.github.com/repos/realmarv/conventions/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/realmarv/conventions/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/realmarv/conventions/teams", + "hooks_url": "https://api.github.com/repos/realmarv/conventions/hooks", + "issue_events_url": "https://api.github.com/repos/realmarv/conventions/issues/events{/number}", + "events_url": "https://api.github.com/repos/realmarv/conventions/events", + "assignees_url": "https://api.github.com/repos/realmarv/conventions/assignees{/user}", + "branches_url": "https://api.github.com/repos/realmarv/conventions/branches{/branch}", + "tags_url": "https://api.github.com/repos/realmarv/conventions/tags", + "blobs_url": "https://api.github.com/repos/realmarv/conventions/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/realmarv/conventions/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/realmarv/conventions/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/realmarv/conventions/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/realmarv/conventions/statuses/{sha}", + "languages_url": "https://api.github.com/repos/realmarv/conventions/languages", + "stargazers_url": "https://api.github.com/repos/realmarv/conventions/stargazers", + "contributors_url": "https://api.github.com/repos/realmarv/conventions/contributors", + "subscribers_url": "https://api.github.com/repos/realmarv/conventions/subscribers", + "subscription_url": "https://api.github.com/repos/realmarv/conventions/subscription", + "commits_url": "https://api.github.com/repos/realmarv/conventions/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/realmarv/conventions/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/realmarv/conventions/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/realmarv/conventions/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/realmarv/conventions/contents/{+path}", + "compare_url": "https://api.github.com/repos/realmarv/conventions/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/realmarv/conventions/merges", + "archive_url": "https://api.github.com/repos/realmarv/conventions/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/realmarv/conventions/downloads", + "issues_url": "https://api.github.com/repos/realmarv/conventions/issues{/number}", + "pulls_url": "https://api.github.com/repos/realmarv/conventions/pulls{/number}", + "milestones_url": "https://api.github.com/repos/realmarv/conventions/milestones{/number}", + "notifications_url": "https://api.github.com/repos/realmarv/conventions/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/realmarv/conventions/labels{/name}", + "releases_url": "https://api.github.com/repos/realmarv/conventions/releases{/id}", + "deployments_url": "https://api.github.com/repos/realmarv/conventions/deployments" + } + } + ] +} diff --git a/scripts/detectNotUsingGitPush1by1.fsx b/scripts/detectNotUsingGitPush1by1.fsx index 02196d9fd..2965e1e9e 100644 --- a/scripts/detectNotUsingGitPush1by1.fsx +++ b/scripts/detectNotUsingGitPush1by1.fsx @@ -63,6 +63,7 @@ let notUsingGitPush1by1 = commit let json = (client.GetStringAsync url).Result + printfn "json: %A" json json.Contains "\"check_suites\":[]" ) diff --git a/scripts/sample.json b/scripts/sample.json new file mode 100644 index 000000000..0a82f2e1f --- /dev/null +++ b/scripts/sample.json @@ -0,0 +1,421 @@ +{ + "total_count": 2, + "check_suites": [ + { + "id": 11828548311, + "node_id": "CS_kwDOIMpMhM8AAAACwQlS1w", + "head_branch": "improveGitPush1by1Check", + "head_sha": "2aacb84cb5a97baa505dcce38807fd27698ef659", + "status": "completed", + "conclusion": "failure", + "url": "https://api.github.com/repos/realmarv/conventions/check-suites/11828548311", + "before": "170a2213ac460c8c3e5651faabc8ca7164c57f84", + "after": "2aacb84cb5a97baa505dcce38807fd27698ef659", + "pull_requests": [ + { + "url": "https://api.github.com/repos/realmarv/conventions/pulls/5", + "id": 1290287503, + "number": 5, + "head": { + "ref": "improveGitPush1by1Check", + "sha": "affc379a8806d2795ddceacdbdce3847eeeeff7b", + "repo": { + "id": 550128772, + "url": "https://api.github.com/repos/realmarv/conventions", + "name": "conventions" + } + }, + "base": { + "ref": "master", + "sha": "0be2f2d608cdf893e146db1296dee750a2a54cfc", + "repo": { + "id": 550128772, + "url": "https://api.github.com/repos/realmarv/conventions", + "name": "conventions" + } + } + } + ], + "app": { + "id": 15368, + "slug": "github-actions", + "node_id": "MDM6QXBwMTUzNjg=", + "owner": { + "login": "github", + "id": 9919, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", + "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github", + "html_url": "https://github.com/github", + "followers_url": "https://api.github.com/users/github/followers", + "following_url": "https://api.github.com/users/github/following{/other_user}", + "gists_url": "https://api.github.com/users/github/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github/subscriptions", + "organizations_url": "https://api.github.com/users/github/orgs", + "repos_url": "https://api.github.com/users/github/repos", + "events_url": "https://api.github.com/users/github/events{/privacy}", + "received_events_url": "https://api.github.com/users/github/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GitHub Actions", + "description": "Automate your workflow from idea to production", + "external_url": "https://help.github.com/en/actions", + "html_url": "https://github.com/apps/github-actions", + "created_at": "2018-07-30T09:30:17Z", + "updated_at": "2019-12-10T19:04:12Z", + "permissions": { + "actions": "write", + "administration": "read", + "checks": "write", + "contents": "write", + "deployments": "write", + "discussions": "write", + "issues": "write", + "merge_queues": "write", + "metadata": "read", + "packages": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "security_events": "write", + "statuses": "write", + "vulnerability_alerts": "read" + }, + "events": [ + "branch_protection_rule", + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "merge_group", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "status", + "watch", + "workflow_dispatch", + "workflow_run" + ] + }, + "created_at": "2023-03-27T09:35:45Z", + "updated_at": "2023-03-27T09:37:34Z", + "rerequestable": true, + "runs_rerequestable": false, + "latest_check_runs_count": 1, + "check_runs_url": "https://api.github.com/repos/realmarv/conventions/check-suites/11828548311/check-runs", + "head_commit": { + "id": "2aacb84cb5a97baa505dcce38807fd27698ef659", + "tree_id": "ed82c4dcfc4f6a1acebc9ae6ec113ca7b9b6c25b", + "message": "wip2", + "timestamp": "2023-03-27T09:34:51Z", + "author": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + }, + "committer": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + } + }, + "repository": { + "id": 550128772, + "node_id": "R_kgDOIMpMhA", + "name": "conventions", + "full_name": "realmarv/conventions", + "private": false, + "owner": { + "login": "realmarv", + "id": 50144546, + "node_id": "MDQ6VXNlcjUwMTQ0NTQ2", + "avatar_url": "https://avatars.githubusercontent.com/u/50144546?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/realmarv", + "html_url": "https://github.com/realmarv", + "followers_url": "https://api.github.com/users/realmarv/followers", + "following_url": "https://api.github.com/users/realmarv/following{/other_user}", + "gists_url": "https://api.github.com/users/realmarv/gists{/gist_id}", + "starred_url": "https://api.github.com/users/realmarv/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/realmarv/subscriptions", + "organizations_url": "https://api.github.com/users/realmarv/orgs", + "repos_url": "https://api.github.com/users/realmarv/repos", + "events_url": "https://api.github.com/users/realmarv/events{/privacy}", + "received_events_url": "https://api.github.com/users/realmarv/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/realmarv/conventions", + "description": null, + "fork": true, + "url": "https://api.github.com/repos/realmarv/conventions", + "forks_url": "https://api.github.com/repos/realmarv/conventions/forks", + "keys_url": "https://api.github.com/repos/realmarv/conventions/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/realmarv/conventions/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/realmarv/conventions/teams", + "hooks_url": "https://api.github.com/repos/realmarv/conventions/hooks", + "issue_events_url": "https://api.github.com/repos/realmarv/conventions/issues/events{/number}", + "events_url": "https://api.github.com/repos/realmarv/conventions/events", + "assignees_url": "https://api.github.com/repos/realmarv/conventions/assignees{/user}", + "branches_url": "https://api.github.com/repos/realmarv/conventions/branches{/branch}", + "tags_url": "https://api.github.com/repos/realmarv/conventions/tags", + "blobs_url": "https://api.github.com/repos/realmarv/conventions/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/realmarv/conventions/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/realmarv/conventions/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/realmarv/conventions/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/realmarv/conventions/statuses/{sha}", + "languages_url": "https://api.github.com/repos/realmarv/conventions/languages", + "stargazers_url": "https://api.github.com/repos/realmarv/conventions/stargazers", + "contributors_url": "https://api.github.com/repos/realmarv/conventions/contributors", + "subscribers_url": "https://api.github.com/repos/realmarv/conventions/subscribers", + "subscription_url": "https://api.github.com/repos/realmarv/conventions/subscription", + "commits_url": "https://api.github.com/repos/realmarv/conventions/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/realmarv/conventions/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/realmarv/conventions/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/realmarv/conventions/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/realmarv/conventions/contents/{+path}", + "compare_url": "https://api.github.com/repos/realmarv/conventions/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/realmarv/conventions/merges", + "archive_url": "https://api.github.com/repos/realmarv/conventions/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/realmarv/conventions/downloads", + "issues_url": "https://api.github.com/repos/realmarv/conventions/issues{/number}", + "pulls_url": "https://api.github.com/repos/realmarv/conventions/pulls{/number}", + "milestones_url": "https://api.github.com/repos/realmarv/conventions/milestones{/number}", + "notifications_url": "https://api.github.com/repos/realmarv/conventions/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/realmarv/conventions/labels{/name}", + "releases_url": "https://api.github.com/repos/realmarv/conventions/releases{/id}", + "deployments_url": "https://api.github.com/repos/realmarv/conventions/deployments" + } + }, + { + "id": 11828549444, + "node_id": "CS_kwDOIMpMhM8AAAACwQlXRA", + "head_branch": "improveGitPush1by1Check", + "head_sha": "2aacb84cb5a97baa505dcce38807fd27698ef659", + "status": "completed", + "conclusion": "failure", + "url": "https://api.github.com/repos/realmarv/conventions/check-suites/11828549444", + "before": "170a2213ac460c8c3e5651faabc8ca7164c57f84", + "after": "2aacb84cb5a97baa505dcce38807fd27698ef659", + "pull_requests": [ + { + "url": "https://api.github.com/repos/realmarv/conventions/pulls/5", + "id": 1290287503, + "number": 5, + "head": { + "ref": "improveGitPush1by1Check", + "sha": "affc379a8806d2795ddceacdbdce3847eeeeff7b", + "repo": { + "id": 550128772, + "url": "https://api.github.com/repos/realmarv/conventions", + "name": "conventions" + } + }, + "base": { + "ref": "master", + "sha": "0be2f2d608cdf893e146db1296dee750a2a54cfc", + "repo": { + "id": 550128772, + "url": "https://api.github.com/repos/realmarv/conventions", + "name": "conventions" + } + } + } + ], + "app": { + "id": 15368, + "slug": "github-actions", + "node_id": "MDM6QXBwMTUzNjg=", + "owner": { + "login": "github", + "id": 9919, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", + "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github", + "html_url": "https://github.com/github", + "followers_url": "https://api.github.com/users/github/followers", + "following_url": "https://api.github.com/users/github/following{/other_user}", + "gists_url": "https://api.github.com/users/github/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github/subscriptions", + "organizations_url": "https://api.github.com/users/github/orgs", + "repos_url": "https://api.github.com/users/github/repos", + "events_url": "https://api.github.com/users/github/events{/privacy}", + "received_events_url": "https://api.github.com/users/github/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GitHub Actions", + "description": "Automate your workflow from idea to production", + "external_url": "https://help.github.com/en/actions", + "html_url": "https://github.com/apps/github-actions", + "created_at": "2018-07-30T09:30:17Z", + "updated_at": "2019-12-10T19:04:12Z", + "permissions": { + "actions": "write", + "administration": "read", + "checks": "write", + "contents": "write", + "deployments": "write", + "discussions": "write", + "issues": "write", + "merge_queues": "write", + "metadata": "read", + "packages": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "security_events": "write", + "statuses": "write", + "vulnerability_alerts": "read" + }, + "events": [ + "branch_protection_rule", + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "merge_group", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "status", + "watch", + "workflow_dispatch", + "workflow_run" + ] + }, + "created_at": "2023-03-27T09:35:48Z", + "updated_at": "2023-03-27T09:37:18Z", + "rerequestable": true, + "runs_rerequestable": false, + "latest_check_runs_count": 1, + "check_runs_url": "https://api.github.com/repos/realmarv/conventions/check-suites/11828549444/check-runs", + "head_commit": { + "id": "2aacb84cb5a97baa505dcce38807fd27698ef659", + "tree_id": "ed82c4dcfc4f6a1acebc9ae6ec113ca7b9b6c25b", + "message": "wip2", + "timestamp": "2023-03-27T09:34:51Z", + "author": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + }, + "committer": { + "name": "realmarv", + "email": "zahratehraninasab@gmail.com" + } + }, + "repository": { + "id": 550128772, + "node_id": "R_kgDOIMpMhA", + "name": "conventions", + "full_name": "realmarv/conventions", + "private": false, + "owner": { + "login": "realmarv", + "id": 50144546, + "node_id": "MDQ6VXNlcjUwMTQ0NTQ2", + "avatar_url": "https://avatars.githubusercontent.com/u/50144546?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/realmarv", + "html_url": "https://github.com/realmarv", + "followers_url": "https://api.github.com/users/realmarv/followers", + "following_url": "https://api.github.com/users/realmarv/following{/other_user}", + "gists_url": "https://api.github.com/users/realmarv/gists{/gist_id}", + "starred_url": "https://api.github.com/users/realmarv/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/realmarv/subscriptions", + "organizations_url": "https://api.github.com/users/realmarv/orgs", + "repos_url": "https://api.github.com/users/realmarv/repos", + "events_url": "https://api.github.com/users/realmarv/events{/privacy}", + "received_events_url": "https://api.github.com/users/realmarv/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/realmarv/conventions", + "description": null, + "fork": true, + "url": "https://api.github.com/repos/realmarv/conventions", + "forks_url": "https://api.github.com/repos/realmarv/conventions/forks", + "keys_url": "https://api.github.com/repos/realmarv/conventions/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/realmarv/conventions/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/realmarv/conventions/teams", + "hooks_url": "https://api.github.com/repos/realmarv/conventions/hooks", + "issue_events_url": "https://api.github.com/repos/realmarv/conventions/issues/events{/number}", + "events_url": "https://api.github.com/repos/realmarv/conventions/events", + "assignees_url": "https://api.github.com/repos/realmarv/conventions/assignees{/user}", + "branches_url": "https://api.github.com/repos/realmarv/conventions/branches{/branch}", + "tags_url": "https://api.github.com/repos/realmarv/conventions/tags", + "blobs_url": "https://api.github.com/repos/realmarv/conventions/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/realmarv/conventions/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/realmarv/conventions/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/realmarv/conventions/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/realmarv/conventions/statuses/{sha}", + "languages_url": "https://api.github.com/repos/realmarv/conventions/languages", + "stargazers_url": "https://api.github.com/repos/realmarv/conventions/stargazers", + "contributors_url": "https://api.github.com/repos/realmarv/conventions/contributors", + "subscribers_url": "https://api.github.com/repos/realmarv/conventions/subscribers", + "subscription_url": "https://api.github.com/repos/realmarv/conventions/subscription", + "commits_url": "https://api.github.com/repos/realmarv/conventions/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/realmarv/conventions/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/realmarv/conventions/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/realmarv/conventions/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/realmarv/conventions/contents/{+path}", + "compare_url": "https://api.github.com/repos/realmarv/conventions/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/realmarv/conventions/merges", + "archive_url": "https://api.github.com/repos/realmarv/conventions/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/realmarv/conventions/downloads", + "issues_url": "https://api.github.com/repos/realmarv/conventions/issues{/number}", + "pulls_url": "https://api.github.com/repos/realmarv/conventions/pulls{/number}", + "milestones_url": "https://api.github.com/repos/realmarv/conventions/milestones{/number}", + "notifications_url": "https://api.github.com/repos/realmarv/conventions/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/realmarv/conventions/labels{/name}", + "releases_url": "https://api.github.com/repos/realmarv/conventions/releases{/id}", + "deployments_url": "https://api.github.com/repos/realmarv/conventions/deployments" + } + } + ] +} diff --git a/test10.fsx b/test10.fsx new file mode 100644 index 000000000..2826d1b51 --- /dev/null +++ b/test10.fsx @@ -0,0 +1,13 @@ +open System.IO +#r "nuget: FSharp.Data, Version=5.0.2" +open FSharp.Data + +[] +let ResolutionFolder = __SOURCE_DIRECTORY__ +// let checkSuitsType = File.ReadAllText("scripts/checkSuitsType.json") +type Simple = JsonProvider<"scripts/checkSuitsType.json", ResolutionFolder=ResolutionFolder> + +let sample = File.ReadAllText("scripts/sample.json") +let value = Simple.Parse sample + +printfn "value: %A" value.CheckSuites.[0].Repository.FullName