Skip to content

Commit

Permalink
Make update of verions in manifest.yml optional
Browse files Browse the repository at this point in the history
  • Loading branch information
aggarw13 committed Jul 28, 2021
1 parent 0af6a29 commit 495868a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion manifest-verifier/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'List of comma-separated relative path to submodules that should not be present in manifest.yml. Eg libraries/thirdparty/tinycbor,libraries/thirdparty/mbedtls'
required: false
default: ''
fail-on-incorrect-version:
description: 'Boolean flag to indicate if verification should fail if any submodule version in manifest.yml file is incorrect or stale.'
required: false
default: 'false'
runs:
using: "composite"
steps:
Expand All @@ -17,5 +21,10 @@ runs:
shell: bash
- name: Run verifier script
working-directory: ${{ inputs.path }}
run: python3 $GITHUB_ACTION_PATH/verify_manifest.py --ignore-submodule-path=${{ inputs.exclude-submodules }}
run: |
if [[ "${{ inputs.fail-on-incorrect-version }}" == "true" ]]
python3 $GITHUB_ACTION_PATH/verify_manifest.py --ignore-submodule-path=${{ inputs.exclude-submodules }} --fail-on-incorrect-version
else
python3 $GITHUB_ACTION_PATH/verify_manifest.py --ignore-submodule-path=${{ inputs.exclude-submodules }}
fi
shell: bash
6 changes: 4 additions & 2 deletions manifest-verifier/verify_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ def get_all_submodules():
parser.add_argument('--ignore-submodule-path',
type=str,
required=None,
default=os.getcwd(),
help='Comma-separated list of submodules path to ignore.')
parser.add_argument('--fail-on-incorrect-versions',
action='store_true',
help='Flag to indicate script to fail for incorrect submodules versions in manifest.yml')

args = parser.parse_args()

Expand Down Expand Up @@ -107,7 +109,7 @@ def get_all_submodules():
print('manifest.yml does not have correct commit ID for', submodule_name,'manifest Commit=(',manifest_commit, submodule.head.commit,') Actual Commit=',submodules_info_from_git[relative_path])
mismatch_flag = True

if mismatch_flag:
if mismatch_flag and args.fail_on_incorrect_versions:
sys.exit(1)

print('\nmanifest.yml file has been verified!')
Expand Down

0 comments on commit 495868a

Please sign in to comment.