Skip to content

Bump requests from 2.32.5 to 2.33.0 #724

Bump requests from 2.32.5 to 2.33.0

Bump requests from 2.32.5 to 2.33.0 #724

Workflow file for this run

name: PR Quality Check
on: pull_request
jobs:
link-ticket:
runs-on: ubuntu-latest
steps:
# 1) Validate branch name without shell (no user data in `run`)
- name: Check ticket name conforms to requirements
id: validate
uses: actions/github-script@v8
with:
script: |
const ref = context.payload.pull_request.head.ref || '';
const ok = /(apm-\d+)|(amb-\d+)|(dependabot\/)/i.test(ref);
if (!ok) {
core.setFailed(`Branch name "${ref}" must match /(apm-[0-9]+)|(amb-[0-9]+)|(dependabot\\/)/i`);
}
# 2) Safely grab ticket name in JS and expose as an output (no ::set-env, no shell)
- name: Grab ticket name
if: contains(github.event.pull_request.head.ref, 'apm-') || contains(github.event.pull_request.head.ref, 'APM-') || contains(github.event.pull_request.head.ref, 'amb-') || contains(github.event.pull_request.head.ref, 'AMB-')
id: ticket
uses: actions/github-script@v8
with:
# return the ticket in uppercase; becomes steps.ticket.outputs.result
result-encoding: string
script: |
const ref = context.payload.pull_request.head.ref || '';
const match = ref.match(/(apm-\d+)|(amb-\d+)/i);
return match ? match[0].toUpperCase() : '';
# 3) Comment with link to JIRA ticket (uses safe output, not shell)
- name: Comment on PR with link to JIRA ticket
if: (contains(github.event.pull_request.head.ref, 'apm-') || contains(github.event.pull_request.head.ref, 'APM-') || contains(github.event.pull_request.head.ref, 'amb-') || contains(github.event.pull_request.head.ref, 'AMB-')) && steps.ticket.outputs.result != ''
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |
This branch is work on a ticket in the NHS Digital AMB JIRA Project. Here's a handy link to the ticket:
# [${{ steps.ticket.outputs.result }}](https://nhsd-jira.digital.nhs.uk/browse/${{ steps.ticket.outputs.result }})
# 4) Comment with link to Spec (still safe—no shell, input-only usage)
- name: Comment on PR with link to Spec
if: contains(github.event.pull_request.head.ref, 'apm-') || contains(github.event.pull_request.head.ref, 'APM-') || contains(github.event.pull_request.head.ref, 'apmspii-') || contains(github.event.pull_request.head.ref, 'APMSPII-') || contains(github.event.pull_request.head.ref, 'adz-') || contains(github.event.pull_request.head.ref, 'ADZ-')
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |
This branch is working on a ticket to deploy to internal-portal. Here's a handy link to the specification:
# [${{ github.event.pull_request.head.ref }} specification](https://internal-portal.developer.nhs.uk/docs/hello-world-pr-${{ github.event.number }}/1/overview)