Add a 'source-root' input to the init Action by mario-campos · Pull Request #607 · github/codeql-action (original) (raw)

added 3 commits

June 29, 2021 15:16

@mario-campos

This input is exposed in the CodeQL CLI as the flag --source-root, allowing users of the CLI to set --source-root different from --working-dir. However, in codeql-action, these two paths are conflated and it poses problems for users with complicated build environments, in which a source root may be a child of the working directory.

Most users should not notice this, as the default value is ${{ github.workspace }}, as it is implied now (path.resolve()).

@mario-campos

In the previous commit, the default value of the input is ${{ github.workspace }} which means that most uses of this input would probably prefix their paths with ${{ github.workspace }}, especially since actions/checkout's 'path' input must be under ${{ github.workspace }}. Therefore, it doesn't make much sense for this to be an absolute file path.

Instead, it's more intuitive to make this relative to the repository.

@mario-campos

It causes the action to break (or rather that context being unavailable causes it to fail), despite it being in the description field.

@mario-campos

@mario-campos

aibaars

aibaars

robertbrignull

@mario-campos @aibaars

Previously, I had tried to refer to '${{ github.workspace }}', but that caused a problem in Actions. Trying to avoid the issue, I changed this to "the workspace," but this gives up quite a bit of specificity.

Co-authored-by: Arthur Baars aibaars@github.com

@mario-campos @aibaars

Thanks to @aibaars, path.resolve() should will nicely handle more use-cases, namely absolute paths better than path.join().

Co-authored-by: Arthur Baars aibaars@github.com

@mario-campos

@adityasharad

adityasharad

@mario-campos

@mario-campos

@mario-campos

This config file 'ought to have some queries good for testing!

adityasharad

@mario-campos @adityasharad

The test is not related to packaging.

Co-authored-by: Aditya Sharad 6874315+adityasharad@users.noreply.github.com

@mario-campos

Moving the files into ../action was causing the job to fail because it couldn't find the test directory anymore. According to @adityasharad, these 'mv's should not be necessary. Removing these means changing the path to the actions.

I'm also removing the 'config-file' input to keep the test minimal. I think this will mean that CodeQL will use the default query suite, so I hope that this doesn't change the results.

@mario-campos

…tion into source-root-input

@mario-campos

@mario-campos

As this test is using only JS, it's not necessary to compile or analyze the other languages.

@mario-campos

This is for PR #607, 'source-root' input test case.

adityasharad

@mario-campos @adityasharad

Co-authored-by: Aditya Sharad 6874315+adityasharad@users.noreply.github.com

@mario-campos

IssacAlegre

@aibaars

aofaof0907 pushed a commit to aofaof0907/codeql-action that referenced this pull request

Jul 29, 2021

@mario-campos @aofaof0907

aofaof0907 pushed a commit to aofaof0907/codeql-action that referenced this pull request

Jul 29, 2021

@mario-campos @aofaof0907

aofaof0907 pushed a commit to aofaof0907/codeql-action that referenced this pull request

Jul 29, 2021

@mario-campos @aofaof0907

aofaof0907 pushed a commit to aofaof0907/codeql-action that referenced this pull request

Jul 29, 2021

@mario-campos @aofaof0907

aofaof0907 pushed a commit to aofaof0907/codeql-action that referenced this pull request

Jul 29, 2021

@mario-campos @aofaof0907

This is for PR github#607, 'source-root' input test case.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})