Skip to content

Fix headers validation for requests that receive empty headers #279

Fix headers validation for requests that receive empty headers

Fix headers validation for requests that receive empty headers #279

name: Create Pull Request Prerelease
on: pull_request
jobs:
build:
if: ${{ github.repository_owner == 'cloudflare' }}
name: Build & Publish a Prerelease to the Adhoc Registry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
- run: npm install --frozen-lockfile
- run: npm run build
- name: Create package
run: npm pack
- name: Upload packaged chanfana artifact
uses: actions/upload-artifact@v4
with:
name: npm-package-chanfana-${{ github.event.number }} # encode the PR number into the artifact name
path: chanfana-*.tgz
- name: 'Put PR and workflow ID on the environment'
uses: actions/github-script@v7
with:
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
for (const artifact of allArtifacts.data.artifacts) {
// Extract the PR number from the artifact name
const match = /^npm-package-chanfana-(\d+)$/.exec(artifact.name);
if (match) {
require("fs").appendFileSync(
process.env.GITHUB_ENV,
`\nWORKFLOW_RUN_PR=${match[1]}` +
`\nWORKFLOW_RUN_ID=${context.payload.workflow_run.id}`
);
break;
}
}
- name: 'Comment on PR with Link'
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ env.WORKFLOW_RUN_PR }}
message: |
🧪 A prerelease is available for testing 🧪
You can install this latest build in your project with:
```sh
npm install --save https://prerelease-registry.devprod.cloudflare.dev/chanfana/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-chanfana-${{ env.WORKFLOW_RUN_PR }}
```
Or you can immediately run this with `npx`:
```sh
npx https://prerelease-registry.devprod.cloudflare.dev/chanfana/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-chanfana-${{ env.WORKFLOW_RUN_PR }}
```