Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions __tests__/setup-go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('setup-go', () => {
getManifestSpy = jest.spyOn(tc, 'getManifestFromRepo');
getAllVersionsSpy = jest.spyOn(im, 'getManifest');

// httm
// httpm
httpmGetJsonSpy = jest.spyOn(httpm.HttpClient.prototype, 'getJson');
Comment on lines -95 to 96
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments should match code, so this fixes the comment to match the code.


// io
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('setup-go', () => {
expect(main.parseGoVersion(goVersionOutput)).toBe('1.16.6');
});

it('can find 1.9.7 from manifest on osx', async () => {
it('can find 1.9.7 from manifest on macOS', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

osx was never the correct name for the brand so this changes it to use the current one

os.platform = 'darwin';
os.arch = 'x64';

Expand Down Expand Up @@ -544,7 +544,7 @@ describe('setup-go', () => {
expect(added).toBeFalsy();
});

it('adds bin if dir not exists', async () => {
it('adds bin if dir does not exist', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nonexistent might be better, but this test description doesn't actually make sense.
Why would anyone add a bin directory if it doesn't exist?

it might be better to write if missing, if that's what it's trying to achieve.

whichSpy.mockImplementation(async () => {
return '/usr/local/go/bin/go';
});
Expand Down Expand Up @@ -756,7 +756,7 @@ describe('setup-go', () => {
);
});

it('fallback to dist if version is not found in manifest', async () => {
it('fall back to dist if version is not found in manifest', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fallback is a noun, but this phrase wants the verb (phrase) which is fall back.

os.platform = 'linux';
os.arch = 'x64';

Expand Down Expand Up @@ -793,7 +793,7 @@ describe('setup-go', () => {
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`);
});

it('fallback to dist if manifest is not available', async () => {
it('fall back to dist if manifest is not available', async () => {
os.platform = 'linux';
os.arch = 'x64';

Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup Go environment'
description: 'Setup a Go environment and add it to the PATH'
description: 'Set up a Go environment and add it to the PATH'
author: 'GitHub'
inputs:
go-version:
Expand All @@ -8,13 +8,13 @@ inputs:
description: 'Path to the go.mod, go.work, .go-version, or .tool-versions file.'
check-latest:
description: 'Set this option to true if you want the action to always check for the latest available version that satisfies the version spec'
default: false
default: 'false'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a yaml file and github's action syntax asserts that the default field is a string, but false (and true) would be parsed as booleans by yaml parsers which makes parsers very upset.

The correct thing to do to make the parsers happy is to add quotes around booleans.

token:
description: Used to pull Go distributions from go-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
cache:
description: Used to specify whether caching is needed. Set to true, if you'd like to enable caching.
default: true
default: 'true'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a yaml file and github's action syntax asserts that the default field is a string, but true (and false) would be parsed as booleans by yaml parsers which makes parsers very upset.

The correct thing to do to make the parsers happy is to add quotes around booleans.

cache-dependency-path:
description: 'Used to specify the path to a dependency file (e.g., go.mod, go.sum)'
architecture:
Expand Down
4 changes: 2 additions & 2 deletions docs/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Pull requests are the easiest way to contribute changes to git repos at GitHub.
- Please check that no one else has already created a pull request with these changes
- Use a "feature branch" for your changes. That separates the changes in the pull request from your other changes and makes it easy to edit/amend commits in the pull request
- Make sure your changes are formatted correctly and consistently with the rest of the documentation
- Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything
- Re-read what you wrote, and run a spell checker on it to make sure you didn't miss anything
- If your pull request is connected to an open issue, please, leave a link to this issue in the `Related issue:` section
- If you later need to add new commits to the pull request, you can simply commit the changes to the local branch and then push them. The pull request gets automatically updated

Expand Down Expand Up @@ -62,7 +62,7 @@ Pull requests are the easiest way to contribute changes to git repos at GitHub.
- To implement new features or fix bugs, you need to make changes to the `.ts` files, which are located in the `src` folder
- To comply with the code style, **you need to run the `format` script**
- To lint the code, **you need to run the `lint:fix` script**
- To transpile source code to `javascript` we use [NCC](https://github.com/vercel/ncc). **It is very important to run the `build` script after making changes**, otherwise your changes will not get into the final `javascript` build
- To transpile source code to `javascript` we use [NCC](https://github.com/vercel/ncc). **It is very important to run the `build` script after making changes**; otherwise, your changes will not get into the final `javascript` build
- You can also start formatting, building code, and testing with a single `pre-checkin` command

**Learn more about how to implement tests:**
Expand Down