Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/update-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Update GraphQL Schema

on:
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened]

jobs:
update-schema:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}

- name: Download latest schema
run: |
curl -s https://hackerone.com/schema.graphql -o /tmp/new_schema.graphql

- name: Check if schema has changed
id: check_changes
run: |
if ! cmp -s /tmp/new_schema.graphql graphql/schema.graphql; then
echo "schema_changed=true" >> $GITHUB_OUTPUT
echo "Schema has changed"
else
echo "schema_changed=false" >> $GITHUB_OUTPUT
echo "Schema is up to date"
fi

- name: Update schema file
if: steps.check_changes.outputs.schema_changed == 'true'
run: |
cp /tmp/new_schema.graphql graphql/schema.graphql

- name: Commit changes
if: steps.check_changes.outputs.schema_changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add graphql/schema.graphql
git commit -m "Update GraphQL schema from HackerOne"
git push

- name: Comment on PR
if: steps.check_changes.outputs.schema_changed == 'true'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🔄 **GraphQL Schema Updated**\n\nThe GraphQL schema has been automatically updated from HackerOne\'s latest schema. Please review the changes before merging.'
})

- name: Skip comment if no changes
if: steps.check_changes.outputs.schema_changed == 'false'
run: echo "No schema changes detected, skipping update"
217 changes: 217 additions & 0 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6602,6 +6602,54 @@ type BulkCreateCredentialsPayload implements MutationResult {
was_successful: Boolean!
}

"""
Autogenerated input type of BulkCreateUpdateDeleteCredentials
"""
input BulkCreateUpdateDeleteCredentialsInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
deleted_credentials: [String!]!
new_credentials: [String!]!
structured_scope_id: Int!
updated_credentials: [String!]!
}

"""
Autogenerated return type of BulkCreateUpdateDeleteCredentials.
"""
type BulkCreateUpdateDeleteCredentialsPayload implements MutationResult {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
credentials: [Credential!]
errors(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String

"""
Returns the elements in the list that come before the specified cursor.
"""
before: String

"""
Returns the first _n_ elements from the list.
"""
first: Int

"""
Returns the last _n_ elements from the list.
"""
last: Int
types: [ErrorTypeEnum]
): ErrorConnection!
was_successful: Boolean!
}

"""
Autogenerated input type of BulkDestroyOrganizationMemberGroups
"""
Expand Down Expand Up @@ -9317,6 +9365,56 @@ type CreateCampaignPayload implements MutationResult {
was_successful: Boolean!
}

"""
Autogenerated input type of CreateCodeReviewForReport
"""
input CreateCodeReviewForReportInput {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
code_review_diff_url: String
code_review_patch: String!
message: String!
report_id: Int!
}

"""
Autogenerated return type of CreateCodeReviewForReport.
"""
type CreateCodeReviewForReportPayload implements MutationResult {
activity: ActivitiesCodeReviewRequested

"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
errors(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String

"""
Returns the elements in the list that come before the specified cursor.
"""
before: String

"""
Returns the first _n_ elements from the list.
"""
first: Int

"""
Returns the last _n_ elements from the list.
"""
last: Int
types: [ErrorTypeEnum]
): ErrorConnection!
report: Report
was_successful: Boolean!
}

"""
Autogenerated input type of CreateCommonResponse
"""
Expand Down Expand Up @@ -23880,6 +23978,12 @@ type Mutation implements Node {
"""
input: BulkCreateCredentialsInput!
): BulkCreateCredentialsPayload!
bulkCreateUpdateDeleteCredentials(
"""
Parameters for BulkCreateUpdateDeleteCredentials
"""
input: BulkCreateUpdateDeleteCredentialsInput!
): BulkCreateUpdateDeleteCredentialsPayload!
bulkDestroyOrganizationMemberGroups(
"""
Parameters for BulkDestroyOrganizationMemberGroups
Expand Down Expand Up @@ -24120,6 +24224,12 @@ type Mutation implements Node {
"""
input: CreateCampaignInput!
): CreateCampaignPayload!
createCodeReviewForReport(
"""
Parameters for CreateCodeReviewForReport
"""
input: CreateCodeReviewForReportInput!
): CreateCodeReviewForReportPayload!
createCommonResponse(
"""
Parameters for CreateCommonResponse
Expand Down Expand Up @@ -26061,6 +26171,12 @@ type Mutation implements Node {
"""
input: UpdateOrganizationProfileInput!
): UpdateOrganizationProfilePayload!
updateOrganizationReturnOnMitigationSettings(
"""
Parameters for UpdateOrganizationReturnOnMitigationSettings
"""
input: UpdateOrganizationReturnOnMitigationSettingsInput!
): UpdateOrganizationReturnOnMitigationSettingsPayload!
updateOrganizationSamlProviderAlternativeCertificate(
"""
Parameters for UpdateOrganizationSamlProviderAlternativeCertificate
Expand Down Expand Up @@ -29158,6 +29274,7 @@ type OrganizationReportDocument implements Node {
structured_scope: JSON
submitted_at: ISO8601DateTime
substate: String
tags: [String!]
text_custom_field_1: String
text_custom_field_10: String
text_custom_field_100: String
Expand Down Expand Up @@ -48827,6 +48944,106 @@ type UpdateOrganizationProfilePayload implements MutationResult {
was_successful: Boolean!
}

"""
Autogenerated input type of UpdateOrganizationReturnOnMitigationSettings
"""
input UpdateOrganizationReturnOnMitigationSettingsInput {
"""
Annual rate of occurrence for availability incidents
"""
availability_annual_rate_of_occurrence: Float

"""
Single Loss Expectancy from a High impact availability incident (as percentage of the SLE baseline)
"""
availability_single_loss_expectancy_high: Float

"""
Single Loss Expectancy from a Low impact availability incident (as percentage of the SLE baseline)
"""
availability_single_loss_expectancy_low: Float

"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String

"""
Annual rate of occurrence for confidentiality incidents
"""
confidentiality_annual_rate_of_occurrence: Float

"""
Single Loss Expectancy from a High impact confidentiality incident (as percentage of the SLE baseline)
"""
confidentiality_single_loss_expectancy_high: Float

"""
Single Loss Expectancy from a Low impact confidentiality incident (as percentage of the SLE baseline)
"""
confidentiality_single_loss_expectancy_low: Float

"""
Industry category for ROM calculations, drives the baseline single loss expectancy
"""
industry: IndustryEnum

"""
Annual rate of occurrence for integrity incidents
"""
integrity_annual_rate_of_occurrence: Float

"""
Single Loss Expectancy from a High impact integrity incident (as percentage of the SLE baseline)
"""
integrity_single_loss_expectancy_high: Float

"""
Single Loss Expectancy from a Low impact integrity incident (as percentage of the SLE baseline)
"""
integrity_single_loss_expectancy_low: Float
organization_id: ID!

"""
Revenue cohort for ROM calculations, drives the baseline single loss expectancy
"""
revenue_cohort: RevenueCohortEnum
}

"""
Autogenerated return type of UpdateOrganizationReturnOnMitigationSettings.
"""
type UpdateOrganizationReturnOnMitigationSettingsPayload implements MutationResult {
"""
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
errors(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String

"""
Returns the elements in the list that come before the specified cursor.
"""
before: String

"""
Returns the first _n_ elements from the list.
"""
first: Int

"""
Returns the last _n_ elements from the list.
"""
last: Int
types: [ErrorTypeEnum]
): ErrorConnection!
organization: Organization!
was_successful: Boolean!
}

"""
Autogenerated input type of UpdateOrganizationSamlProviderAlternativeCertificate
"""
Expand Down