diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e3c95e1..ac68099 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -13,9 +13,9 @@ jobs: matrix: node-version: [16.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'npm' @@ -26,7 +26,7 @@ jobs: - run: npm install - run: npm test - name: Codecov - uses: codecov/codecov-action@v2.1.0 + uses: codecov/codecov-action@v3 analyze: needs: build runs-on: ubuntu-latest @@ -40,22 +40,22 @@ jobs: language: [ 'javascript' ] steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 publish: needs: analyze runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 16.x - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16.x cache: 'npm' diff --git a/bundle-publish.js b/bundle-publish.js index a7734ff..278f7cd 100644 --- a/bundle-publish.js +++ b/bundle-publish.js @@ -22,23 +22,26 @@ glob(pattern) console.error(err); } else { const content = contentBuffer.toString(); - const gistId = content.match(/downloadURL.*joshparkerj\/([^/]*)/)[1]; - const description = content.match(/description\s+(.*)/)[1]; - const filename = file.includes('meta') ? content.match(/updateURL.*raw\/([^/]*)/)[1] : content.match(/downloadURL.*raw\/([^/]*)/)[1]; + const gistIdMatch = content.match(/downloadURL.*joshparkerj\/([^/]*)/); + if (gistIdMatch) { + const gistId = gistIdMatch[1]; + const description = content.match(/description\s+(.*)/)[1]; + const filename = file.includes('meta') ? content.match(/updateURL.*raw\/([^/]*)/)[1] : content.match(/downloadURL.*raw\/([^/]*)/)[1]; - octokit.request(`PATCH /gists/${gistId}`, { - gist_id: gistId, - description, - files: { - [filename]: { - filename, - content, + octokit.request(`PATCH /gists/${gistId}`, { + gist_id: gistId, + description, + files: { + [filename]: { + filename, + content, + }, }, - }, - }) - .then(() => { - upload(i + 1); - }); + }) + .then(() => { + upload(i + 1); + }); + } } }); }