Releases: JasonEtco/actions-toolkit
v1.10.0
Testing!
This release improves the CLI scaffold template with a new file: index.test.js
. It outlines a pattern for testing GItHub Actions with actions-toolkit, leveraging Toolkit.run
. Try it out with:
npx actions-toolkit <folder>
I'll be sharing some docs on this soon!
What’s Changed
- Fix publish workflow (#72) @JasonEtco
- Include test file in CLI scaffold (#73) @JasonEtco
v2.0.0-beta.2
This release furthers the beta of v2.0.0 (#62). It reverts the changes added in #41 for exiting with a failing status with missing environment variables - this is due to additional friction and inconsistent lists that made the feature a little unreliable, so better to remove it.
What’s Changed
- Use logger in exit (#64) @JasonEtco
- Create CLI questionnaire (#57) @macklinu
- Add Toolkit.run (#63) @jclem
- Support non-async functions in Toolkit.run (#67) @JasonEtco
- Add
secrets
option (#66) @JasonEtco - Fix missing methods on
tools.log
(#69) @JasonEtco - Remove GITHUB_REF and GITHUB_TOKEN from required env vars (#71) @JasonEtco
v1.9.1
What’s Changed
- Fix missing methods on
tools.log
(#69) @JasonEtco - Remove GITHUB_REF and GITHUB_TOKEN from required env vars (#71) @JasonEtco
v1.9.0: `secrets` option
New feature
This release introduces the secrets
option. If present, the Action will exit and fail if required secrets have not been set. Here's an example:
action "My action" {
uses = "JasonEtco/secrets@master"
secrets = ["API_KEY"]
}
// This will fail because `API_SECRET` wasn't passed!
new Toolkit({ secrets: ['API_KEY', 'API_SECRET'] })
Check out #66 for all the details ✨
What’s Changed
- Add
secrets
option (#66) @JasonEtco
v1.8.1
What’s Changed
- Support non-async functions in Toolkit.run (#67) @JasonEtco
v1.8.0: Toolkit#run
New feature
In #63, @jclem added a new static method to the Toolkit class: #run
. It takes a function argument and runs that function, as a way of enabling easier async/await
patterns and modularity. Check it out!
const { Toolkit } = require('actions-toolkit')
Toolkit.run(async tools => {
tools.log.success('We did it team!')
})
What’s Changed
- Use logger in exit (#64) @JasonEtco
- Add Toolkit.run (#63) @jclem
v1.7.0: CLI Magic
Enhanced CLI
This release introduces a wonderfully enhanced CLI tool for creating a new GitHub Action, courtesy of @macklinu. Check out #57 for the full details ✨ You can run it through npx
:
npx actions-toolkit my-action
What’s Changed
- Use logger in exit (#64) @JasonEtco
- Create CLI questionnaire (#57) @macklinu
v2.0.0-beta.1
Nothing to see here, just fixing a release process that borked for 2.0.0-beta.1
and resulted in an empty publish.
v2.0.0-beta.0
This release introduces a few breaking changes, for reliability and for clarity.
Required environment variables, #41
The first is a change to the Toolkit constructor - the list of environment variables that are available in the GitHub Actions runtime is now required when using actions-toolkit. This is to encourage predictability, and while it won't break any Actions being run by GitHub, it may affect automated tests that don't set all of the expected environment variables. I'm really looking for feedback on this change - if it feels too heavy handed, let me know in #62!
context.repo
and context.issue
are objects, not functions #61
I love this change (shoutout @jclem) - tools.context.repo
and tools.context.issue
are no longer functions that take an object parameter, but are rather helper getter
s that return an object:
- const params = tools.context.repo({ foo: true })
+ const params = { ...tools.context.repo, foo: true }
This is much more semantic and standard, and should result in less confusion for folks that aren't familiar with Probot's API.
1.6.0: Toolkit#command
New feature
This release introduces Toolkit#command
, a new method that will run the provided function when a matching slash-command is found. From the README:
Respond to a slash-command posted in a GitHub issue, comment, pull request, pull request review or commit comment. Arguments to the slash command are parsed by minimist. You can use a slash command in a larger comment, but the command must be at the start of the line:
Hey, let's deploy this!
/deploy --app example --container node:alpine
tools.command('deploy', async (args: ParsedArgs, match: RegExpExecArray) => {
console.log(args)
// -> { app: 'example', container: 'node:alpine' }
})
What’s Changed
- Slash commands (#53) @JasonEtco