11# Copyright (c) Microsoft Corporation.
22# Licensed under the MIT License.
3-
3+ ---
44name : Check Package CGManifests
55
66on :
@@ -20,44 +20,44 @@ jobs:
2020 runs-on : [ubuntu-latest]
2121
2222 steps :
23- - name : Check out code
24- uses : actions/checkout@v4
25- with :
23+ - name : Check out code
24+ uses : actions/checkout@v4
25+ with :
2626 persist-credentials : false
2727
28- # This PR runner uses an older Ubuntu with rpm version 4.17, which doesn't understand some newer macros like %bcond
29- - name : Define missing rpm macros
30- run : |
31- if [[ -n $(rpm --eval '%bcond test 1') ]]; then
32- echo '%bcond() %[ (%{2}) ? "%{expand:%%bcond_without %{1}}" : "%{expand:%%bcond_with %{1}}" ]' > ~/.rpmmacros
33- fi
34-
35- - name : Get base commit for PRs
36- if : ${{ github.event_name == 'pull_request' }}
37- run : |
38- base_ref="${BASE_REF}"
39- git fetch origin $base_ref
40- echo "base_sha=$(git rev-parse origin/$base_ref)" >> "$GITHUB_ENV"
41- echo "Merging ${{ github.sha }} into $base_ref"
42- env :
43- BASE_REF : ${{ github.base_ref }}
44-
45- - name : Get base commit for Pushes
46- if : ${{ github.event_name == 'push' }}
47- run : |
48- git fetch origin ${{ github.event.before }}
49- echo "base_sha=${{ github.event.before }}" >> "$GITHUB_ENV"
50- echo "Merging ${{ github.sha }} into ${{ github.event.before }}"
51-
52- - name : Get the changed files
53- run : |
54- echo "Files changed: '$(git diff-tree --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }})'"
55- changed_specs=$(git diff-tree --diff-filter=d --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }} | { grep "SPECS.*/.*\.spec$" || test $? = 1; } | awk '{printf "%s ", $0}')
56- echo "Files to validate: '${changed_specs}'"
57- echo "updated-specs=${changed_specs}" >> "$GITHUB_ENV"
58-
59- - name : Check each spec
60- run : |
61- .github/workflows/overwrite_shell_link.sh
62- .github/workflows/validate-cg-manifest.sh ${{ env.updated-specs }}
63- shell : bash
28+ # This PR runner uses an older Ubuntu with rpm version 4.17, which doesn't understand some newer macros like %bcond
29+ - name : Define missing rpm macros
30+ run : |
31+ if [[ -n $(rpm --eval '%bcond test 1') ]]; then
32+ echo '%bcond() %[ (%{2}) ? "%{expand:%%bcond_without %{1}}" : "%{expand:%%bcond_with %{1}}" ]' > ~/.rpmmacros
33+ fi
34+
35+ - name : Get base commit for PRs
36+ if : ${{ github.event_name == 'pull_request' }}
37+ run : |
38+ base_ref="${BASE_REF}"
39+ git fetch origin $base_ref
40+ echo "base_sha=$(git rev-parse origin/$base_ref)" >> "$GITHUB_ENV"
41+ echo "Merging ${{ github.sha }} into $base_ref"
42+ env :
43+ BASE_REF : ${{ github.base_ref }}
44+
45+ - name : Get base commit for Pushes
46+ if : ${{ github.event_name == 'push' }}
47+ run : |
48+ git fetch origin ${{ github.event.before }}
49+ echo "base_sha=${{ github.event.before }}" >> "$GITHUB_ENV"
50+ echo "Merging ${{ github.sha }} into ${{ github.event.before }}"
51+
52+ - name : Get the changed files
53+ run : |
54+ echo "Files changed: '$(git diff-tree --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }})'"
55+ changed_specs=$(git diff-tree --diff-filter=d --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }} | { grep "SPECS.*/.*\.spec$" || test $? = 1; } | awk '{printf "%s ", $0}')
56+ echo "Files to validate: '${changed_specs}'"
57+ echo "updated-specs=${changed_specs}" >> "$GITHUB_ENV"
58+
59+ - name : Check each spec
60+ run : |
61+ .github/workflows/overwrite_shell_link.sh
62+ .github/workflows/validate-cg-manifest.sh ${{ env.updated-specs }}
63+ shell : bash
0 commit comments