Skip to content

Chore: [AEA-0000] - add standard lifecycle scripts #374

Chore: [AEA-0000] - add standard lifecycle scripts

Chore: [AEA-0000] - add standard lifecycle scripts #374

Workflow file for this run

name: pull_request
'on':
pull_request:
branches:
- main
env:
BRANCH_NAME: '${{ github.event.pull_request.head.ref }}'
jobs:
dependabot-auto-approve-and-merge:
needs: quality_checks
uses: >-
NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
secrets:
AUTOMERGE_APP_ID: '${{ secrets.AUTOMERGE_APP_ID }}'
AUTOMERGE_PEM: '${{ secrets.AUTOMERGE_PEM }}'
get_config_values:
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
with:
verify_published_from_main_image: false
quality_checks:
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
needs:
- get_config_values
with:
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
secrets:
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'
pr_title_format_check:
uses: >-
NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
get_issue_number:
runs-on: ubuntu-22.04
needs: quality_checks
outputs:
issue_number: '${{ steps.get_issue_number.outputs.result }}'
version: '${{ steps.get_issue_number.outputs.version_number }}'
steps:
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
name: get issue number
id: get_issue_number
with:
script: |
if (context.issue.number) {
// Return issue number if present
return context.issue.number;
} else {
// Otherwise return issue number from commit
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0].number;
}
result-encoding: string
get_commit_id:
runs-on: ubuntu-22.04
outputs:
commit_id: '${{ steps.commit_id.outputs.commit_id }}'
sha_short: '${{ steps.commit_id.outputs.sha_short }}'
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: '${{ env.BRANCH_NAME }}'
- name: Get Commit ID
id: commit_id
run: |
# echo "commit_id=${{ github.sha }}" >> "$GITHUB_ENV"
echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
build_all_images:
needs:
- get_issue_number
- get_commit_id
uses: ./.github/workflows/build_all_images.yml
with:
docker_tag: 'pr-${{ needs.get_issue_number.outputs.issue_number }}-${{ needs.get_commit_id.outputs.sha_short }}'
tag_latest: false
NO_CACHE: false