mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-30 10:38:08 +08:00
Set main as the default branch (#527)
* set main as the default branch * revert change to tool-cache default branch * use versions where applicable
This commit is contained in:
@@ -32,14 +32,14 @@ jobs:
|
||||
os: [ubuntu-16.04, windows-2019]
|
||||
runs-on: ${{matrix.os}}
|
||||
actions:
|
||||
- uses: actions/setup-node@master
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
version: ${{matrix.node}}
|
||||
- run: |
|
||||
npm install
|
||||
- run: |
|
||||
npm test
|
||||
- uses: actions/custom-action@master
|
||||
- uses: actions/custom-action@v1
|
||||
```
|
||||
|
||||
JavaScript actions work on any environment that host action runtime is supported on which is currently node 12. However, a host action that runs a toolset expects the environment that it's running on to have that toolset in its PATH or using a setup-* action to acquire it on demand.
|
||||
|
||||
@@ -17,13 +17,13 @@ Binding to a major version is the latest of that major version ( e.g. `v1` == "1
|
||||
|
||||
Major versions should guarantee compatibility. A major version can add net new capabilities but should not break existing input compatibility or break existing workflows.
|
||||
|
||||
Major version binding allows you to take advantage of bug fixes and critical functionality and security fixes. The `master` branch has the latest code and is unstable to bind to since changes get committed to master and released to the market place by creating a tag. In addition, a new major version carrying breaking changes will get implemented in master after branching off the previous major version.
|
||||
Major version binding allows you to take advantage of bug fixes and critical functionality and security fixes. The `main` branch has the latest code and is unstable to bind to since changes get committed to main and released to the market place by creating a tag. In addition, a new major version carrying breaking changes will get implemented in main after branching off the previous major version.
|
||||
|
||||
> Warning: do not reference `master` since that is the latest code and can be carrying breaking changes of the next major version.
|
||||
> Warning: do not reference `main` since that is the latest code and can be carrying breaking changes of the next major version.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/javascript-action@master # do not do this
|
||||
- uses: actions/javascript-action@main # do not do this
|
||||
```
|
||||
|
||||
Binding to the immutable full sha1 may offer more reliability. However, note that the hosted images toolsets (e.g. ubuntu-latest) move forward and if there is a tool breaking issue, actions may react with a patch to a major version to compensate so binding to a specific SHA may prevent you from getting fixes.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# :: Commands
|
||||
|
||||
The [core toolkit package](https://github.com/actions/toolkit/tree/master/packages/core) offers a number of convenience functions for
|
||||
The [core toolkit package](https://github.com/actions/toolkit/tree/main/packages/core) offers a number of convenience functions for
|
||||
setting results, logging, registering secrets and exporting variables across actions. Sometimes, however, its useful to be able to do
|
||||
these things in a script or other tool.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ e.g. To use https://github.com/actions/setup-node, users will author:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
using: actions/setup-node@master
|
||||
using: actions/setup-node@v1
|
||||
```
|
||||
|
||||
# Define Metadata
|
||||
|
||||
@@ -111,10 +111,10 @@ Registering two problem-matchers with the same owner will result in only the pro
|
||||
## Examples
|
||||
|
||||
Some of the starter actions are already using problem matchers, for example:
|
||||
- [setup-node](https://github.com/actions/setup-node/tree/master/.github)
|
||||
- [setup-python](https://github.com/actions/setup-python/tree/master/.github)
|
||||
- [setup-go](https://github.com/actions/setup-go/tree/master/.github)
|
||||
- [setup-dotnet](https://github.com/actions/setup-dotnet/tree/master/.github)
|
||||
- [setup-node](https://github.com/actions/setup-node/tree/main/.github)
|
||||
- [setup-python](https://github.com/actions/setup-python/tree/main/.github)
|
||||
- [setup-go](https://github.com/actions/setup-go/tree/main/.github)
|
||||
- [setup-dotnet](https://github.com/actions/setup-dotnet/tree/main/.github)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
Reference in New Issue
Block a user