diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e66be03d8..2e6d7e649 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,28 +2,17 @@ name: Test "on": push: branches: - - master - - dependabot/npm_and_yarn/** - pull_request: - types: - - opened - - synchronize + - 195/import-error-on-windows jobs: test: - runs-on: ubuntu-latest - strategy: - matrix: - node_version: - - 10 - - 12 - - 14 + test: + runs-on: windows-2019 steps: - uses: actions/checkout@v2 - - name: "Use Node.js ${{ matrix.node_version }}" - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1 with: - node-version: "${{ matrix.node_version }}" - - name: Install - run: npm ci - - name: Test - run: npm test + node-version: 10.19.0 + - run: npm ci + - run: node reproduce-195.js + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/reproduce-195.js b/reproduce-195.js new file mode 100644 index 000000000..5d06015fa --- /dev/null +++ b/reproduce-195.js @@ -0,0 +1,18 @@ +import { graphql } from "./pkg"; + +// Azure Function HTTP Trigger entry point +async function run () { + const userToken = process.env.GITHUB_TOKEN + const graphqlWithAuth = graphql.defaults({ + headers: { + authorization: `token ${userToken}`, + }, + }); + + const { data } = await graphqlWithAuth(`{ + viewer { + login + } + }`); + console.log(data); +}