Skip to content

Trex run scripts crash within GitHub Actions #123

@piuswalter

Description

@piuswalter

Describe the bug

When calling trex run [...] in GitHub Actions, they throw an error and abort with error: Uncaught (in promise) Permission denied (os error 13).

To Reproduce

  1. Create a GitHub Actions workflow file as follows.
name: CI - Linting - Backend

on:
  pull_request:

jobs:
  lint:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - uses: denoland/setup-deno@v1
        with:
          deno-version: v1.x

      - name: Install Trex
        run: deno install -A --unstable --import-map=https://deno.land/x/trex/import_map.json -n trex --no-check https://deno.land/x/trex/cli.ts

      - name: Format the backend
        run: cd backend/ && trex run fmt

      - name: Lint the backend
        run: cd backend/ && trex run lint

      - name: Test the backend
        run: cd backend/ && trex run test
  1. The scripts were created in the run.json as follows.
{
  "scripts": {
    "lint": "deno lint --config deno.json",
    "fmt": "deno fmt --config deno.json",
    "test": "deno test --config deno.json --import-map=../import_map.json",
  },
  "files": [
    "./src"
  ]
}
  1. The following error will occur and stop the GitHub Actions.
Run cd backend/ && trex run fmt
  cd backend/ && trex run fmt
  shell: /usr/bin/bash -e {0}
error: Uncaught (in promise) Permission denied (os error 13)
Error: Process completed with exit code 1.

Expected behavior

The GitHub Actions should run the Trex scripts without any problems and should not throw any error and abort.

Screenshots

There are no screenshots available for this problem.

Desktop (please complete the following information):

Additional context

Maybe the problem is caused by the exec deno run --allow-all --quiet --no-check --unstable --import-map 'https://deno.land/x/trex/import_map.json' 'https://deno.land/x/trex/cli.ts' "$@" statement in the trex file in ~/.deno/bin/. This Stack Overflow post describes the problem with GitHub Actions and exec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions