question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add PROJECT_PATH environment variable

See original GitHub issue

Do the checklist before filing an issue:

Motivation

For a variety of reasons, many projects don’t contain their Cargo.toml file in their root directory, or they have multiple sub-projects each with their own Cargo.tomls. Would it be possible to make the project path configurable? That way the community would benefit from being able to run from a specified path. We’ve added this action to a few of our projects and I’m in the process of expanding that to others as it works well, but I’ve hit this issue which seems to block me from using it in projects such as here ~and only the root directory `Cargo.toml in this repo here~ EDIT: was mistaken about this particular linked repo being an example.

Workflow example

name: Security audit
on:
  schedule:
    - cron: '0 0 * * *'
      
  paths: 
jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions-rs/audit-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
        env:
          PROJECT_PATH: ./my_sub_folder

Additional context

As far as I’m aware there’s no way around this at the moment. Been looking for workarounds to this issue I’m facing and found the working-directory option here but turns out it can only be used with run and not with uses. Found a PR here which seems to have resolved this in another action, hoping something similar would work with audit-check.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:16
  • Comments:8

github_iconTop GitHub Comments

4reactions
georglauterbachcommented, Dec 4, 2021

I need this as well. This issue seems to have become stale, but it is quite important. Not every repository has the Rust code / Cargo.toml directly in the repository root.

1reaction
jblachlycommented, Aug 24, 2021

We need this for our monorepo.

See also #194

Ideally, I would suggest letting cargo do the work; it already has a --manifest-path <path/to/Cargo.toml> argument.

In fact, other actions in the actions-rs repo permit this via

with:
  args: --manifest-path mypath/Cargo.toml
Read more comments on GitHub >

github_iconTop Results From Across the Web

Path variables | IntelliJ IDEA Documentation - JetBrains
Press Ctrl+Alt+S to open the IDE settings and select Appearance & Behavior | Path Variables. Path Variables dialog. Click the Add button ,...
Read more >
How To View and Update the Linux PATH Environment Variable
Step 2 — Adding a Directory to the PATH Environment Variable ... A directory can be added to PATH in two ways: at...
Read more >
Add A Directory To A PATH Environment Variable On ...
In this article, I will show you how to add a folder to the Windows 10 PATH variable. Step 1. Press WIN+S to...
Read more >
Understanding the Python Path Environment Variable in Python
1. How do I add an environment variable in Pythonpath? · By setting the Pythonpath environment variable. · By adding manually to the...
Read more >
How to add Python to PATH variable in Windows - Educative.io
Right-clicking This PC and going to Properties. · Clicking on the Advanced system settings in the menu on the left. · Clicking on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found