From 64bfef754db876278212ea03716d55aa80df72fb Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Thu, 13 May 2021 09:14:43 +0900 Subject: [PATCH] ci: update default branch --- .github/workflows/ci.yml | 8 ++++---- README.md | 6 +++--- __test__/command-helper.unit.test.ts | 12 ++++++------ docs/examples.md | 6 +++--- docs/updating.md | 12 ++++++------ 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bf8f98..e594ec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,12 @@ name: CI on: push: - branches: [master] + branches: [main] paths-ignore: - 'README.md' - 'docs/**' pull_request: - branches: [master] + branches: [main] paths-ignore: - 'README.md' - 'docs/**' @@ -29,7 +29,7 @@ jobs: path: dist package: - if: github.event_name == 'push' && github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: [build] runs-on: ubuntu-latest steps: @@ -44,7 +44,7 @@ jobs: commit-message: 'build: update distribution' title: Update distribution body: | - - Updates the distribution for changes on `master` + - Updates the distribution for changes on `main` Auto-generated by [create-pull-request][1] diff --git a/README.md b/README.md index c808021..bdb3af7 100644 --- a/README.md +++ b/README.md @@ -183,13 +183,13 @@ To demonstrate, take the following configuration as an example. region=us-east-1 ``` -For the above example configuration, the slash command `/deploy branch=master dry-run reason="new feature"` will be converted to a JSON payload as follows. +For the above example configuration, the slash command `/deploy branch=main dry-run reason="new feature"` will be converted to a JSON payload as follows. ```json "slash_command": { "command": "deploy", "args": { - "all": "production region=us-east-1 branch=master dry-run reason=\"new feature\"", + "all": "production region=us-east-1 branch=main dry-run reason=\"new feature\"", "unnamed": { "all": "production dry-run", "arg1": "production", @@ -197,7 +197,7 @@ For the above example configuration, the slash command `/deploy branch=master dr }, "named": { "region": "us-east-1", - "branch": "master", + "branch": "main", "reason": "new feature" }, } diff --git a/__test__/command-helper.unit.test.ts b/__test__/command-helper.unit.test.ts index 0785b51..e2ded3f 100644 --- a/__test__/command-helper.unit.test.ts +++ b/__test__/command-helper.unit.test.ts @@ -270,7 +270,7 @@ describe('command-helper tests', () => { test('slash command payload with named args', async () => { const commandTokens = [ 'test', - 'branch_name=master', + 'branch_name=main', 'arg1', 'test-id=123', 'arg2' @@ -279,14 +279,14 @@ describe('command-helper tests', () => { const payload: SlashCommandPayload = { command: 'test', args: { - all: 'branch_name=master arg1 test-id=123 arg2', + all: 'branch_name=main arg1 test-id=123 arg2', unnamed: { all: 'arg1 arg2', arg1: 'arg1', arg2: 'arg2' }, named: { - branch_name: 'master', + branch_name: 'main', 'test-id': '123' } } @@ -295,12 +295,12 @@ describe('command-helper tests', () => { }) test('slash command payload with named args and static args', async () => { - const commandTokens = ['test', 'branch=master', 'arg1', 'dry-run'] + const commandTokens = ['test', 'branch=main', 'arg1', 'dry-run'] const staticArgs = ['production', 'region=us-east-1'] const payload: SlashCommandPayload = { command: 'test', args: { - all: 'production region=us-east-1 branch=master arg1 dry-run', + all: 'production region=us-east-1 branch=main arg1 dry-run', unnamed: { all: 'production arg1 dry-run', arg1: 'production', @@ -309,7 +309,7 @@ describe('command-helper tests', () => { }, named: { region: 'us-east-1', - branch: 'master' + branch: 'main' } } } diff --git a/docs/examples.md b/docs/examples.md index c487927..5b32284 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -9,7 +9,7 @@ ## Use case: Execute command using a specific repository branch -This is a pattern for a slash command where a named argument specifies the branch to checkout. If the named argument is missing it defaults to `master`. For example, the following command will cause the command workflow to checkout the `develop` branch of the repository where the command was dispatched from. After the branch has been checked out in the command workflow, scripts, tools or actions may be executed against it. +This is a pattern for a slash command where a named argument specifies the branch to checkout. If the named argument is missing it defaults to `main`. For example, the following command will cause the command workflow to checkout the `develop` branch of the repository where the command was dispatched from. After the branch has been checked out in the command workflow, scripts, tools or actions may be executed against it. ``` /do-something branch=develop @@ -31,7 +31,7 @@ jobs: id: vars run: | branch=${{ github.event.client_payload.slash_command.args.named.branch }} - if [[ -z "$branch" ]]; then branch="master"; fi + if [[ -z "$branch" ]]; then branch="main"; fi echo ::set-output name=branch::$branch # Checkout the branch to test @@ -82,7 +82,7 @@ jobs: id: vars run: | branch=${{ github.event.client_payload.slash_command.args.named.branch }} - if [[ -z "$branch" ]]; then branch="master"; fi + if [[ -z "$branch" ]]; then branch="main"; fi echo ::set-output name=branch::$branch # Checkout the branch to test diff --git a/docs/updating.md b/docs/updating.md index 926bfee..9c6cb60 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -4,26 +4,26 @@ - The format of the `slash_command` context has been changed to prevent an issue where named arguments can overwrite other properties of the payload. - The following diff shows how the `slash_command` context has changed for the example command `/deploy branch=master smoke-test dry-run reason="new feature"`. + The following diff shows how the `slash_command` context has changed for the example command `/deploy branch=main smoke-test dry-run reason="new feature"`. ```diff "slash_command": { "command": "deploy", - - "args": "branch=master smoke-test dry-run reason=\"new feature\"", + - "args": "branch=main smoke-test dry-run reason=\"new feature\"", - "unnamed_args": "smoke-test dry-run", - "arg1": "smoke-test", - "arg2": "dry-run" - - "branch": "master", + - "branch": "main", - "reason": "new feature" + "args": { - + "all": "branch=master smoke-test dry-run reason=\"new feature\"", + + "all": "branch=main smoke-test dry-run reason=\"new feature\"", + "unnamed": { + "all": "smoke-test dry-run", + "arg1": "smoke-test", + "arg2": "dry-run" + }, + "named": { - + "branch": "master", + + "branch": "main", + "reason": "new feature" + }, + } @@ -59,7 +59,7 @@ e.g. ``` - /deploy branch=master dry-run reason="new feature" + /deploy branch=main dry-run reason="new feature" ``` ``` /send "hello world!"