Skip to content

Commit 262d080

Browse files
committed
Add explicit permissions to GitHub workflows
1 parent 980e31d commit 262d080

5 files changed

Lines changed: 20 additions & 5 deletions

File tree

.github/workflows/branch_release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
tags:
99
- '*'
1010

11+
permissions:
12+
pull-requests: write
13+
contents: write
14+
1115
jobs:
1216
branch_release:
1317
if: github.event.created && github.event.sender.login == 'labkey-teamcity'

.github/workflows/merge_release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
types:
99
- submitted
1010

11+
permissions:
12+
pull-requests: write
13+
contents: write
14+
1115
jobs:
1216
merge_release:
1317
if: >

.github/workflows/validate_pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- reopened
1111
- ready_for_review
1212

13+
permissions:
14+
pull-requests: write
15+
1316
jobs:
1417
validate_pr:
1518
if: github.event.pull_request.head.repo.owner.login == 'LabKey'

modules/simpletest/resources/scripts/validationTest/actionUrlTest.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ function doTest()
2121

2222
if (contextPath.length > 0) {
2323
var baseUrl = LABKEY.ActionURL.getBaseURL();
24-
if (baseUrl.indexOf("labkey/") != baseUrl.length - 7)
24+
if (!baseUrl.endsWith(contextPath + "/"))
2525
errors[errors.length] = new Error("ActionURL.getBaseURL() = " + baseUrl);
2626
}
2727

2828
var queryString = LABKEY.ActionURL.queryString(urlParameters);
29-
if( queryString != 'x=fred&y=barney' )
29+
if( queryString !== 'x=fred&y=barney' )
3030
errors[errors.length] = new Error("ActionURL.queryString = " + queryString);
3131

3232
var url = LABKEY.ActionURL.buildURL(controller, action, containerPath, urlParameters);
33-
if( url != contextPath + "/" + controller + "/" + containerPath + "/" + action + ".view?" + queryString &&
34-
url != contextPath + "/" + containerPath + "/" + controller + "-" + action + ".view?" + queryString)
33+
if( url !== contextPath + "/" + controller + "/" + containerPath + "/" + action + ".view?" + queryString &&
34+
url !== contextPath + "/" + containerPath + "/" + controller + "-" + action + ".view?" + queryString)
3535
errors[errors.length] = new Error("ActionURL.buildUrl() = " + url);
3636

3737
var parameters = LABKEY.ActionURL.getParameters(url);
38-
if( Ext.util.JSON.encode(parameters) != Ext.util.JSON.encode(urlParameters) )
38+
if( Ext.util.JSON.encode(parameters) !== Ext.util.JSON.encode(urlParameters) )
3939
errors[errors.length] = new Error("ActionURL.getParameters() = " + Ext.util.JSON.encode(parameters));
4040

4141
if( errors.length > 0 )

src/org/labkey/test/TestFileUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,10 @@ private static List<File> unTar(final File inputFile, final File outputDir) thro
635635
while ((entry = inputStream.getNextEntry()) != null)
636636
{
637637
final File outputFile = new File(outputDir, entry.getName());
638+
639+
if (!outputFile.toPath().normalize().startsWith(outputDir.toPath()))
640+
throw new IOException("Bad zip entry (" + entry.getName() + ") in " + inputFile.getAbsolutePath());
641+
638642
if (entry.isDirectory())
639643
{
640644
if (!outputFile.exists())

0 commit comments

Comments
 (0)