Skip to content

Commit

Permalink
Merge pull request #118 from AmericanAirlines/dependabot-suggestions-…
Browse files Browse the repository at this point in the history
…20220207

Dependabot suggestions 20220207
  • Loading branch information
leemeador authored Apr 26, 2022
2 parents 676fe8e + ccd27f0 commit f8cc204
Show file tree
Hide file tree
Showing 15 changed files with 3,543 additions and 1,614 deletions.
12 changes: 10 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,17 @@ feature/bugfix branch with `git checkout -b yourNewBranchName` and begin making
#### Committing

When you are ready to commit code, please do so on the feature/bugfix branch (as created above) and commit only the
files that are relevant to your change (e.g., **do not use** `git add .` or `git commit -a`). After the first time you
files that are relevant to your change (e.g., **do not use** `git add .` or `git commit -a` to avoid massive change sets).

*Note that you may not be able to get a build that will pass the **test** workflow if you do the
build described below on **Windows**. It depends. It turns out that the generated .js code is different on
Windows and on the GitHub Linux hosted runners. (Let us know if you learn the same problem
exists for Mac.) That difference will cause the test to fail as it thinks you have not built
the js code from the typescript.*

After the first time you
run `yarn install` to install dependencies, you will be able to run `yarn all` to prepare the action's executable
Javascript for running:
Javascript for running which will do the following:

- `yarn lint:fix` which will lint all changed files and perform corrections where possible
- `yarn pretty:fix` which will use `prettier` on all changed files and perform corrections where possible
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '16.13.2'
cache: 'yarn'
Expand All @@ -25,6 +25,10 @@ jobs:
- name: 'Verify lint/pretty/build made no changes'
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo ----------------------------------------
echo git status --porcelain
echo ----------------------------------------
git status --porcelain
echo ----------------------------------------
echo git status
echo ----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# https://github.com/marketplace/actions/release-drafter
- name: create and publish a release
uses: release-drafter/release-drafter@v5.17.6
uses: release-drafter/release-drafter@v5.19.0
id: createrelease
with:
publish: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: execute the action
uses: ./
Expand Down
3 changes: 2 additions & 1 deletion THIRD_PARTY_NOTICES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Notices:

Copyright Notice and Text
Software repo from which external packages originated: https://github.com/actions/checkout
Version SHA: 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
First Version SHA: 5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
Updated with Version SHA: 2d1c1198e79c30cca5c3957b1e3b65ce95b5356e (3/8/2022 v 1.0.7)
Software packages:

-> action.ts contains source derived from git-source-provider.ts in originating software repo
Expand Down
3,200 changes: 2,608 additions & 592 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions dist/licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,9 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


tr46
MIT

tunnel
MIT
The MIT License (MIT)
Expand Down Expand Up @@ -583,6 +586,47 @@ Permission to use, copy, modify, and/or distribute this software for any purpose
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


webidl-conversions
BSD-2-Clause
# The BSD 2-Clause License

Copyright (c) 2014, Domenic Denicola
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


whatwg-url
MIT
The MIT License (MIT)

Copyright (c) 2015–2016 Sebastian Mayr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


wrappy
ISC
The ISC License
Expand Down
2 changes: 1 addition & 1 deletion dist/sourcemap-register.js

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "GitHub action to preload multiple private actions",
"main": "dist/index.js",
"scripts": {
"build": "tsc --newline lf && ncc build lib/action.js -o dist --source-map --license licenses.txt",
"build": "tsc --newline lf && ncc build lib/action.js -o dist --source-map --license licenses.txt && yarn eolConverter \"dist/*\"",
"lint": "eslint src --ext .ts --max-warnings 0",
"lint:fix": "yarn lint --fix",
"pretty": "yarn prettier -l \"src/**/*.ts\"",
Expand Down Expand Up @@ -41,16 +41,17 @@
"yarn": "^1.22.17"
},
"devDependencies": {
"@types/jest": "27.0.3",
"@types/node": "17.0.10",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"@vercel/ncc": "0.33.1",
"@types/jest": "27.4.1",
"@types/node": "17.0.21",
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"@vercel/ncc": "0.33.3",
"eslint": "7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "4.0.0",
"jest": "^27.4.7",
"jest": "^27.5.1",
"prettier": "^2.5.1",
"eol-converter-cli": "^1.0.8",
"ts-jest": "27.1.3",
"typescript": "^4.5.5"
}
Expand Down
6 changes: 3 additions & 3 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function run(): Promise<void> {
// const payload: string = JSON.stringify(github.context.payload, undefined, 2)
// console.log(`The event payload: ${payload}`)

/* This portion adapted from https://github.com/actions/checkout/tree/5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f (see LICENSE there which is MIT license) */
/* This portion adapted from https://github.com/actions/checkout/tree/2d1c1198e79c30cca5c3957b1e3b65ce95b5356e main.ts (see LICENSE there which is MIT license) */

// Remove conflicting file path
if (fsHelper.fileExistsSync(workingDirectory)) {
Expand Down Expand Up @@ -71,8 +71,8 @@ async function run(): Promise<void> {

core.endGroup();
}
} catch (error: any) {
core.setFailed(error.message);
} catch (error) {
core.setFailed((error as any)?.message ?? error);
}
}

Expand Down
26 changes: 15 additions & 11 deletions src/fs-helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from 'fs';

/**
* Portions adapted from https://github.com/actions/checkout/tree/5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f (see LICENSE there which is MIT license)
* Portions adapted from https://github.com/actions/checkout/tree/2d1c1198e79c30cca5c3957b1e3b65ce95b5356e fs-helper.ts (see LICENSE there which is MIT license)
*/

export function directoryExistsSync(path: string, required?: boolean): boolean {
Expand All @@ -12,16 +12,16 @@ export function directoryExistsSync(path: string, required?: boolean): boolean {
let stats: fs.Stats;
try {
stats = fs.statSync(path);
} catch (error: any) {
if (error.code === 'ENOENT') {
} catch (error) {
if ((error as any)?.code === 'ENOENT') {
if (!required) {
return false;
}

throw new Error(`Directory '${path}' does not exist`);
}

throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(error as any)?.message ?? error}`);
}

if (stats.isDirectory()) {
Expand All @@ -40,12 +40,12 @@ export function existsSync(path: string): boolean {

try {
fs.statSync(path);
} catch (error: any) {
if (error.code === 'ENOENT') {
} catch (error) {
if ((error as any)?.code === 'ENOENT') {
return false;
}

throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(error as any)?.message ?? error}`);
}

return true;
Expand All @@ -59,13 +59,17 @@ export function fileExistsSync(path: string): boolean {
let stats: fs.Stats;
try {
stats = fs.statSync(path);
} catch (error: any) {
if (error.code === 'ENOENT') {
} catch (error) {
if ((error as any)?.code === 'ENOENT') {
return false;
}

throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(error as any)?.message ?? error}`);
}

return !stats.isDirectory();
if (!stats.isDirectory()) {
return true;
}

return false;
}
4 changes: 2 additions & 2 deletions src/git-command-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as io from '@actions/io';
import * as github from '@actions/github';

/**
* Portions adapted from https://github.com/actions/checkout/tree/5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f (see LICENSE there which is MIT license)
* Portions adapted from https://github.com/actions/checkout/tree/2d1c1198e79c30cca5c3957b1e3b65ce95b5356e git-command-manager.ts (see LICENSE there which is MIT license)
*/

// requires git version 2.18 or greater to work
Expand Down Expand Up @@ -162,7 +162,7 @@ export class GitCommandManager {
console.log(`git executable is ${this.gitPath}`);

// Git version
console.log('Getting git version');
core.debug('Getting git version');
let gitVersion = '';
const gitOutput = await this.execGit(['version']);
const stdout = gitOutput.stdout.trim();
Expand Down
Loading

0 comments on commit f8cc204

Please sign in to comment.