ci: update default branch
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
+6
-6
@@ -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!"
|
||||
|
||||
Reference in New Issue
Block a user