diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml deleted file mode 100644 index 64e85eb..0000000 --- a/.github/workflows/differential-shellcheck.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Differential ShellCheck -on: - push: - branches: [main] - pull_request: - branches: [main] - -permissions: - contents: read - -jobs: - lint: - runs-on: ubuntu-latest - - permissions: - security-events: write - - steps: - - name: Repository checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - id: ShellCheck - name: Differential ShellCheck - uses: redhat-plumbers-in-action/differential-shellcheck@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - if: always() - name: Upload artifact with ShellCheck defects in SARIF format - uses: actions/upload-artifact@v4 - with: - name: Differential ShellCheck SARIF - path: ${{ steps.ShellCheck.outputs.sarif }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3030436 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,53 @@ +name: Publish package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + cache-dependency-path: yarn.lock + + - name: Install + run: yarn install + + - name: Compile + run: yarn build + + - name: Test + run: yarn test + + publish-npm: + needs: build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + + - name: Install + run: yarn install + + - name: Compile + run: yarn build + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/src/types.ts b/src/types.ts index a94ba2c..ee98be9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -408,8 +408,8 @@ export interface Attachment { summary: string; content_type: string; is_private: boolean | int; - is_obsolete: boolean; - is_patch: boolean; + is_obsolete: boolean | int; + is_patch: boolean | int; creator: string; flags: Flag[]; } @@ -425,8 +425,8 @@ export const AttachmentSpec: ObjectSpec = { summary: string, content_type: string, is_private: either(boolean, int), - is_obsolete: boolean, - is_patch: boolean, + is_obsolete: either(boolean, int), + is_patch: either(boolean, int), creator: string, flags: array(object(FlagSpec)), }; @@ -470,7 +470,7 @@ export interface UpdateAttachmentContent { content_type?: string; is_patch?: boolean; is_private?: boolean; - is_obsolete?: boolean; + is_obsolete?: boolean | int; flags?: UpdateFlag[]; }