Repository navigation
72 lines (63 loc) · 2.4 KB
/
Copy pathvalidate.yml
File metadata and controls
72 lines (63 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Validate release manifests
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Run tests and validate manifests
run: make validate
- name: Validate release manifest change
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: scripts/check_release_changes.sh "$BASE_SHA" HEAD
- name: Select release manifest for preflight
if: github.event_name == 'pull_request'
id: selected
shell: bash
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
manifest="$(
git diff --diff-filter=A --name-only "$BASE_SHA...HEAD" -- \
'releases/*.yml' 'releases/*.yaml' | head -n 1
)"
if [[ -n "$manifest" ]]; then
echo "present=true" >> "$GITHUB_OUTPUT"
echo "manifest=$manifest" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
fi
- name: Read release manifest for preflight
if: steps.selected.outputs.present == 'true'
id: manifest
run: ruby script/manifest github-output "${{ steps.selected.outputs.manifest }}"
- name: Preflight component commits and versions
if: steps.selected.outputs.present == 'true'
env:
GH_TOKEN: ${{ github.token }}
BACKEND_REPOSITORY: ${{ steps.manifest.outputs.backend_repository }}
BACKEND_COMMIT: ${{ steps.manifest.outputs.backend_commit }}
BACKEND_VERSION: ${{ steps.manifest.outputs.backend_version }}
BACKEND_TAG: ${{ steps.manifest.outputs.backend_tag }}
APP_REPOSITORY: ${{ steps.manifest.outputs.app_repository }}
APP_COMMIT: ${{ steps.manifest.outputs.app_commit }}
APP_VERSION: ${{ steps.manifest.outputs.app_version }}
APP_BUILD_NUMBER: ${{ steps.manifest.outputs.app_build_number }}
APP_TAG: ${{ steps.manifest.outputs.app_tag }}
run: scripts/preflight.sh
- name: Validate GitHub Actions workflows
run: make actionlint