-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull request primarily focuses on improving the code quality and readability of the project. It involves changes to the ESLint configuration, updates to the GitHub Actions workflow, and modifications to the `README.md` and `CONTRIBUTING.md` files. Furthermore, the pull request includes updates to the test suite and several fixture files. ### General Configuration - Moved linting/configuration files out of `.github/linters` for visibility. - Added the `LINTER_RULES_PATH` environment variable to the `linter.yml` workflow to update the path where the linter rules are located. - Trim `.gitignore` down. ### ESLint Configuration - Remove unnecessary paths from `.eslintignore`. - Ignore several linting rules related to `.js` files being used as test fixtures. - Update to use ECMAScript version ES2022. ### TypeScript Configuration - Enabled `.js` imports for JavaScript actions. ### Testing - Switched from Mocha/Chai to Jest for testing (Chai required dependencies that were no longer being maintained). - Separated test fixtures by language. - Added basic TypeScript/JavaScript test fixtures to simulate actions projects. - Added mocks for `@actions/core`. - Disabled caching to resolve errors when testing `commands/run.ts`. - Added ### Documentation - Several small tweaks to `README.md` (formatting and clarity). - Added `npm link` testing instructions to `CONTRIBUTING.md`. ### Functionality/Logic - Moved the `@actions/core` stubs to separate exported functions. - Separated types and enums into their own code files. Closes #31
- Loading branch information
Showing
69 changed files
with
7,153 additions
and
3,696 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
lib/ | ||
dist/ | ||
node_modules/ | ||
coverage/ | ||
*.json |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,7 @@ | ||
# Dependency directory | ||
node_modules | ||
|
||
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# OS metadata | ||
.DS_Store | ||
coverage | ||
node_modules | ||
npm-debug.log* | ||
reports | ||
Thumbs.db | ||
|
||
# Ignore built ts files | ||
__tests__/runner/* | ||
|
||
# IDE files | ||
.idea | ||
*.code-workspace |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.6.0 |
File renamed without changes.
This file contains 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
This file contains 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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
__tests__/fixtures/failure/action.yml → __fixtures__/javascript/failure/action.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: MyAction | ||
name: JavaScript (Failing) | ||
description: This action sets a failure status | ||
|
||
runs: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable import/no-commonjs */ | ||
|
||
const { run } = require('./main') | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
run() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable import/no-commonjs */ | ||
|
||
const core = require('@actions/core') | ||
|
||
// eslint-disable-next-line @typescript-eslint/require-await | ||
async function run() { | ||
core.setFailed('JavaScript Action Failed!') | ||
} | ||
|
||
module.exports = { | ||
run | ||
} |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: JavaScript (No Import) | ||
description: This action doesn't import any dependencies | ||
|
||
inputs: | ||
myInput: | ||
description: An input | ||
required: true | ||
default: 'default value' | ||
|
||
outputs: | ||
myOutput: | ||
description: An output | ||
|
||
runs: | ||
using: node20 | ||
main: dist/index.js |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable import/no-commonjs */ | ||
|
||
const { run } = require('./main') | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
run() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* eslint-disable import/no-commonjs */ | ||
|
||
// eslint-disable-next-line @typescript-eslint/require-await | ||
async function run() { | ||
return | ||
} | ||
|
||
module.exports = { | ||
run | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
__tests__/fixtures/success/action.yml → __fixtures__/javascript/success/action.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: MyAction | ||
name: JavaScript (Success) | ||
description: This action returns without error | ||
|
||
inputs: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable import/no-commonjs */ | ||
|
||
const { run } = require('./main') | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
run() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable import/no-commonjs */ | ||
|
||
const core = require('@actions/core') | ||
|
||
// eslint-disable-next-line @typescript-eslint/require-await | ||
async function run() { | ||
const myInput = core.getInput('myInput') | ||
core.setOutput('myOutput', myInput) | ||
core.info('JavaScript Action Succeeded!') | ||
} | ||
|
||
module.exports = { | ||
run | ||
} |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: TypeScript (Failing) | ||
description: This action sets a failure status | ||
|
||
runs: | ||
using: node20 | ||
main: dist/index.js |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { run } from './main' | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
run() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import * as core from '@actions/core' | ||
|
||
// eslint-disable-next-line @typescript-eslint/require-await | ||
export async function run(): Promise<void> { | ||
core.setFailed('TypeScript Action Failed!') | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Do not commit your actual .env file to Git! This may contain secrets or other | ||
# private information. | ||
|
||
# GitHub Actions inputs should follow `INPUT_<name>` format (case-insensitive). | ||
INPUT_milliseconds=2400 | ||
|
||
# Enable/disable step debug logs | ||
ACTIONS_STEP_DEBUG=false |
Oops, something went wrong.