Skip to content

feat: enhance GetHackerOneReportByID query with additional fields #8

feat: enhance GetHackerOneReportByID query with additional fields

feat: enhance GetHackerOneReportByID query with additional fields #8

Workflow file for this run

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 "[email protected]"
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"