Skip to content

Commit

Permalink
Sets output via Python script
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Feb 24, 2024
1 parent 7c986fd commit cc7d160
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@ runs:
--verbose
playbook: run.yml
requirements: requirements.yml
- run: echo "MT_FACT=$(jq -c . < /etc/ansible/facts.d/metatrader.fact)" >> $GITHUB_ENV
- run: echo '${{ fromJson(env.MT_FACT) }}'
- name: Sets output
run: |
import json, os
try:
with open("/etc/ansible/facts.d/metatrader.fact", "r") as file:
data = json.load(file)
mt_path = data.get("5").get("path")
with open(os.getenv('GITHUB_ENV'), "a") as file_env:
file_env.write(f"MT_PATH={mt_path}\\n")
except FileNotFoundError:
print("Error: File not found.")
shell: python
- run: echo '${{ fromJson(env.MT_PATH) }}'
shell: bash
using: composite

0 comments on commit cc7d160

Please sign in to comment.