Add serial (#1)

* Update update-from-mds.yml

* Update update-from-mds.yml

* Update update-from-mds.yml

* Update update-from-mds.yml

* Update update-from-mds.yml

* Update update-from-mds.yml

* Update update-from-mds.yml

* Delete combined_aaguid.json

* Update update-from-mds.yml

* bot: Updated Fri Sep 15 14:49:54 UTC 2023, from MDS file version 31, next update expected 2023-10-01.

---------

Co-authored-by: GitHub Action <action@github.com>
pull/21/head
Alex Seigler 2023-09-15 10:52:35 -04:00 committed by GitHub
parent 0e3109c6e8
commit a555bfdf1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 8 deletions

View File

@ -28,6 +28,7 @@ jobs:
with:
fail-on-error: false
script: |
import os
import requests
import base64
import json
@ -43,7 +44,15 @@ jobs:
mds_bytes = base64.b64decode(jwt_payload)
mds_strings = mds_bytes.decode('utf-8')
mds_data = json.loads(mds_strings)
# Build commit msg and export to environment variable
mds_number = mds_data['no']
mds_next = mds_data['nextUpdate']
commit_msg=f'COMMIT_MSG=from MDS file version {mds_number}, next update expected {mds_next}.'
env_file = os.getenv('GITHUB_ENV')
with open(env_file, "a") as myfile:
myfile.write(commit_msg)
# Extract FIDO2 statements with non-null aaguid and required properties
fido2_statements = [
entry['metadataStatement']
@ -70,14 +79,11 @@ jobs:
# Write combined result to file
with open('combined_aaguid.json', 'w') as output_file:
json.dump(result, output_file)
- name: Commit files
- name: Commit files and push
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "bot: Update file" -a
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
timestamp=$(date -u)
git commit -m "bot: Updated ${timestamp}, ${{ env.COMMIT_MSG }}" -a || exit 0
git push