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
parent
0e3109c6e8
commit
a555bfdf1c
|
@ -28,6 +28,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fail-on-error: false
|
fail-on-error: false
|
||||||
script: |
|
script: |
|
||||||
|
import os
|
||||||
import requests
|
import requests
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
|
@ -43,7 +44,15 @@ jobs:
|
||||||
mds_bytes = base64.b64decode(jwt_payload)
|
mds_bytes = base64.b64decode(jwt_payload)
|
||||||
mds_strings = mds_bytes.decode('utf-8')
|
mds_strings = mds_bytes.decode('utf-8')
|
||||||
mds_data = json.loads(mds_strings)
|
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
|
# Extract FIDO2 statements with non-null aaguid and required properties
|
||||||
fido2_statements = [
|
fido2_statements = [
|
||||||
entry['metadataStatement']
|
entry['metadataStatement']
|
||||||
|
@ -70,14 +79,11 @@ jobs:
|
||||||
# Write combined result to file
|
# Write combined result to file
|
||||||
with open('combined_aaguid.json', 'w') as output_file:
|
with open('combined_aaguid.json', 'w') as output_file:
|
||||||
json.dump(result, output_file)
|
json.dump(result, output_file)
|
||||||
- name: Commit files
|
- name: Commit files and push
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "action@github.com"
|
git config --local user.email "action@github.com"
|
||||||
git config --local user.name "GitHub Action"
|
git config --local user.name "GitHub Action"
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "bot: Update file" -a
|
timestamp=$(date -u)
|
||||||
- name: Push changes
|
git commit -m "bot: Updated ${timestamp}, ${{ env.COMMIT_MSG }}" -a || exit 0
|
||||||
uses: ad-m/github-push-action@v0.6.0
|
git push
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
branch: main
|
|
||||||
|
|
Loading…
Reference in New Issue