Fixing protect request format (#2155)

This commit is contained in:
Justin Dalrymple 2021-10-17 14:22:06 -04:00 committed by GitHub
parent 60970b155c
commit c09fae4e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 33 deletions

View File

@ -80,6 +80,9 @@ workflows:
- canary:
name: 'Deploy Canary Build'
filters:
branches:
ignore: master
requires:
- Lint Src
- Lint Docs
@ -403,6 +406,14 @@ jobs:
- image: node:lts-alpine
steps:
- checkout
- restore_cache:
name: Restore yarn package cache
keys:
- yarn-{{ checksum "yarn.lock" }}
- restore_cache:
name: Restore build cache
keys:
- build-{{ .Environment.CIRCLE_WORKFLOW_ID }}
- run: |
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm config set always-auth=true
@ -420,6 +431,14 @@ jobs:
- image: node:lts-alpine
steps:
- checkout
- restore_cache:
name: Restore yarn package cache
keys:
- yarn-{{ checksum "yarn.lock" }}
- restore_cache:
name: Restore build cache
keys:
- build-{{ .Environment.CIRCLE_WORKFLOW_ID }}
- run: |
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm config set always-auth=true

View File

@ -9,14 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'
on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '16 0 * * 4'
@ -32,40 +32,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@ -37,8 +37,10 @@ export class ProtectedBranches<C extends boolean = false> extends BaseResource<C
const pId = encodeURIComponent(projectId);
return RequestHelper.post<ProtectedBranchSchema>()(this, `projects/${pId}/protected_branches`, {
name: branchName,
...options,
query: {
name: branchName,
...options,
},
});
}

View File

@ -47,8 +47,10 @@ describe('ProtectedBranches.protect', () => {
await service.protect(1, 'name', { test: 1 });
expect(RequestHelper.post()).toHaveBeenCalledWith(service, 'projects/1/protected_branches', {
name: 'name',
test: 1,
query: {
name: 'name',
test: 1,
},
});
});
});