Skip to content

Commit

Permalink
controlled debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarbuzzi committed Sep 28, 2024
1 parent 5f66987 commit 1a990cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
28 changes: 19 additions & 9 deletions actions/testmo-create-resources/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: create testmo resources
description: create a TestMo resource .json file

inputs:
testmo_token:
description: testmo token
required: true
resources_file:
description: file name where the resources will be stored
required: true
Expand All @@ -16,23 +13,36 @@ inputs:
required: false

runs:
env:
RESOURCES_FILE: ${{ inputs.resources_file }}
RESOURCES_JSON: ${{ inputs.resources_json }}
using: composite
steps:
- run: 'echo "starting PATH: $PATH"'

- name: add actions path to PATH
shell: bash
run: echo "${{ github.action_path }}" >> $GITHUB_PATH

- name: compose TESTMO resources file
run: |
echo "composing TESTMO resources file ${{ inputs.resources_file }} ..."
echo "shell CWD: $(pwd)"
echo "generating/updating Testmo resources file '$RESOURCES_FILE'"
echo "== node =="
node --version
which node
echo "== node =="
npx --version
which npx
echo $PATH
echo "cwd: $(pwd) -- contents:"
ls -A
compose_testmo_resources_file.py \
--resources_json '${{ inputs.resources_json }}' \
--destination "${{ inputs.resources_file }}"
echo "cwd: $(pwd) -- contents:"
ls -A
echo "resource file ${{ inputs.resources_json }} contents:"
cat "${{ inputs.resources_file }}"
env:
TESTMO_TOKEN: ${{ inputs.testmo_token }}
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
help="absolute path for where to generate the file,",
type=str)

print(f"cwd: {pathlib.Path.cwd()}") # noqa: T201
print(f"(py) cwd: {pathlib.Path.cwd()}") # noqa: T201
args = args_parser.parse_args()
fields = json.loads(args.resources_json)

Expand All @@ -47,12 +47,7 @@
print(f"running command: {shlex.join(full_command)}") # noqa: T201

# run the command and raise any exceptions
subprocess.run( # noqa: S602
full_command,
check=True,
cwd=pathlib.Path.cwd(),
shell=True
)
subprocess.run(full_command, check=True)

print(f"destination: {args.destination}") # noqa: T201
print(f"exists: {pathlib.Path(args.destination).exists()}") # noqa: T201

0 comments on commit 1a990cc

Please sign in to comment.