Skip to content

feat/fix: Add missing specification to GitHub Acti #1

feat/fix: Add missing specification to GitHub Acti

feat/fix: Add missing specification to GitHub Acti #1

Workflow file for this run

import yaml
def update_workflow_file(file_path):

Check failure on line 3 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

You have an error in your yaml syntax on line 3
# Open the workflow file
with open(file_path, 'r') as file:
# Parse the YAML content
workflow_dict = yaml.safe_load(file)
# Locate the google-github-actions/auth@v1 step
steps = workflow_dict['jobs']['build']['steps']
for step in steps:
if step['uses'] == 'google-github-actions/auth@v1':
# Add the missing specification as an input
step['with'] = {
'workload_identity_provider': 'your_workload_identity_provider',
# or
'credentials_json': 'your_credentials_json'
}
# Inject the input value into the environment
step['env'] = {
'YOUR_ENV_VARIABLE': '${{ secrets.YOUR_SECRET }}'
}
# Save the modified workflow file
with open(file_path, 'w') as file:
yaml.dump(workflow_dict, file)
# Update the workflow file
update_workflow_file(".github/workflows/main.yml")