Skip to content
Prev Previous commit
Next Next commit
Correct template-specific workflow syntax (github#5104)
Co-authored-by: Lucas Costi <[email protected]>
  • Loading branch information
steven-wolfman and lucascosti authored Apr 13, 2021
commit 92b3b22da915064a4881b752d3ad323495c9a833
6 changes: 3 additions & 3 deletions content/actions/guides/building-and-testing-nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ We recommend that you have a basic understanding of Node.js, YAML, workflow conf

{% data variables.product.prodname_dotcom %} provides a Node.js workflow template that will work for most Node.js projects. This guide includes npm and Yarn examples that you can use to customize the template. For more information, see the [Node.js workflow template](https://github.com/actions/starter-workflows/blob/main/ci/node.js.yml).

To get started quickly, add the template to the `.github/workflows` directory of your repository.
To get started quickly, add the template to the `.github/workflows` directory of your repository. The workflow shown below assumes that the default branch for your repository is `main`.

{% raw %}
```yaml{:copy}
name: Node.js CI

on:
push:
branches: [ $default-branch ]
branches: [ main ]
pull_request:
branches: [ $default-branch ]
branches: [ main ]

jobs:
build:
Expand Down
20 changes: 10 additions & 10 deletions content/actions/guides/building-and-testing-ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ We recommend that you have a basic understanding of Ruby, YAML, workflow configu

{% data variables.product.prodname_dotcom %} provides a Ruby workflow template that will work for most Ruby projects. For more information, see the [Ruby workflow template](https://github.com/actions/starter-workflows/blob/master/ci/ruby.yml).

To get started quickly, add the template to the `.github/workflows` directory of your repository.
To get started quickly, add the template to the `.github/workflows` directory of your repository. The workflow shown below assumes that the default branch for your repository is `main`.

{% raw %}
```yaml
name: Ruby

on:
push:
branches: [ $default-branch ]
branches: [ main ]
pull_request:
branches: [ $default-branch ]
branches: [ main ]

jobs:
test:
Expand Down Expand Up @@ -105,9 +105,9 @@ name: Ruby CI

on:
push:
branches: [ $default-branch ]
branches: [ main ]
pull_request:
branches: [ $default-branch ]
branches: [ main ]

jobs:
test:
Expand Down Expand Up @@ -211,9 +211,9 @@ name: Matrix Testing

on:
push:
branches: [ $default-branch ]
branches: [ main ]
pull_request:
branches: [ $default-branch ]
branches: [ main ]

jobs:
test:
Expand Down Expand Up @@ -272,11 +272,11 @@ name: Ruby Gem
on:
# Manually publish
workflow_dispatch:
# Alternatively, publish whenever changes are merged to the default branch.
# Alternatively, publish whenever changes are merged to the `main` branch.
push:
branches: [ $default-branch ]
branches: [ main ]
pull_request:
branches: [ $default-branch ]
branches: [ main ]

jobs:
build:
Expand Down