forked from actions/create-github-app-token
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use dash notation for inputs (deprecates underscore notation) (a…
…ctions#59) Fixes actions#57 This PR implements the 3-step plan proposed by @gr2m in actions#57 (comment): > 1. Support both input types > 2. Log a deprecation warning for the old notation > 3. Add a test for deprecations Although this PR supports both input formats simultaneously, I opted _not_ to document the old format in the updated README. That’s a decision I’m happy to revisit, if y’all would prefer to have documentation for both the old and new formats.
- Loading branch information
Showing
17 changed files
with
145 additions
and
33 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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { readFileSync } from "node:fs"; | ||
import * as url from "node:url"; | ||
import YAML from "yaml"; | ||
|
||
const action = YAML.parse( | ||
readFileSync( | ||
url.fileURLToPath(new URL("../action.yml", import.meta.url)), | ||
"utf8" | ||
) | ||
); | ||
|
||
for (const [key, value] of Object.entries(action.inputs)) { | ||
if ("deprecationMessage" in value) { | ||
console.log(`${key} — ${value.deprecationMessage}`); | ||
} | ||
} |
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,9 @@ | ||
process.env.GITHUB_REPOSITORY_OWNER = "actions"; | ||
process.env.GITHUB_REPOSITORY = "actions/create-github-app-token"; | ||
|
||
// Verify `main` exits with an error when neither the `app-id` nor `app_id` input is set. | ||
try { | ||
await import("../main.js"); | ||
} catch (error) { | ||
console.error(error.message); | ||
} |
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 @@ | ||
process.env.GITHUB_REPOSITORY_OWNER = "actions"; | ||
process.env.GITHUB_REPOSITORY = "actions/create-github-app-token"; | ||
process.env["INPUT_APP-ID"] = "123456"; | ||
|
||
// Verify `main` exits with an error when neither the `private-key` nor `private_key` input is set. | ||
try { | ||
await import("../main.js"); | ||
} catch (error) { | ||
console.error(error.message); | ||
} |
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
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
Binary file not shown.