From 061b186ec0496af32411a9281d2f8f8ca403575d Mon Sep 17 00:00:00 2001 From: Paulina Kalicka <71526180+paulinek13@users.noreply.github.com> Date: Mon, 27 Jan 2025 10:39:23 +0100 Subject: [PATCH 1/2] Update file and directory names to use backticks (#36059) --- .../building-and-testing-java-with-ant.md | 4 ++-- .../building-and-testing-java-with-gradle.md | 2 +- .../building-and-testing-java-with-maven.md | 4 ++-- .../building-and-testing-nodejs.md | 16 ++++++++-------- .../building-and-testing-python.md | 2 +- .../building-and-testing-ruby.md | 2 +- data/reusables/actions/setup-node-intro.md | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-ant.md b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-ant.md index 3b38e111ae42..84d862c1cc65 100644 --- a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-ant.md +++ b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-ant.md @@ -90,9 +90,9 @@ We recommend that you have a basic understanding of Java and the Ant framework. You can use the same commands that you use locally to build and test your code. -The workflow template will run the default target specified in your _build.xml_ file. Your default target will commonly be set to build classes, run tests and package classes into their distributable format, for example, a JAR file. +The workflow template will run the default target specified in your `build.xml` file. Your default target will commonly be set to build classes, run tests and package classes into their distributable format, for example, a JAR file. -If you use different commands to build your project, or you want to run a different target, you can specify those. For example, you may want to run the `jar` target that's configured in your `_build-ci.xml_` file. +If you use different commands to build your project, or you want to run a different target, you can specify those. For example, you may want to run the `jar` target that's configured in your `build-ci.xml` file. ```yaml copy steps: diff --git a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-gradle.md b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-gradle.md index a67f08440154..cdc5bb2df62d 100644 --- a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-gradle.md +++ b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-gradle.md @@ -103,7 +103,7 @@ You can use the same commands that you use locally to build and test your code. The workflow template will run the `build` task by default. In the default Gradle configuration, this command will download dependencies, build classes, run tests, and package classes into their distributable format, for example, a JAR file. -If you use different commands to build your project, or you want to use a different task, you can specify those. For example, you may want to run the `package` task that's configured in your _ci.gradle_ file. +If you use different commands to build your project, or you want to use a different task, you can specify those. For example, you may want to run the `package` task that's configured in your `ci.gradle` file. ```yaml copy steps: diff --git a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven.md b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven.md index 4cd3b9aeccab..06bfa290bf33 100644 --- a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven.md +++ b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven.md @@ -97,7 +97,7 @@ You can use the same commands that you use locally to build and test your code. The workflow template will run the `package` target by default. In the default Maven configuration, this command will download dependencies, build classes, run tests, and package classes into their distributable format, for example, a JAR file. -If you use different commands to build your project, or you want to use a different target, you can specify those. For example, you may want to run the `verify` target that's configured in a _pom-ci.xml_ file. +If you use different commands to build your project, or you want to use a different target, you can specify those. For example, you may want to run the `verify` target that's configured in a `pom-ci.xml` file. ```yaml copy steps: @@ -127,7 +127,7 @@ steps: run: mvn --batch-mode --update-snapshots verify ``` -This workflow will save the contents of your local Maven repository, located in the `.m2` directory of the runner's home directory. The cache key will be the hashed contents of _pom.xml_, so changes to _pom.xml_ will invalidate the cache. +This workflow will save the contents of your local Maven repository, located in the `.m2` directory of the runner's home directory. The cache key will be the hashed contents of `pom.xml`, so changes to `pom.xml` will invalidate the cache. ## Packaging workflow data as artifacts diff --git a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs.md b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs.md index 1f335c16c0cd..9eb99ad99ee6 100644 --- a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs.md +++ b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs.md @@ -154,7 +154,7 @@ You can also cache dependencies to speed up your workflow. For more information, ### Example using npm -This example installs the versions in the _package-lock.json_ or _npm-shrinkwrap.json_ file and prevents updates to the lock file. Using `npm ci` is generally faster than running `npm install`. For more information, see [`npm ci`](https://docs.npmjs.com/cli/ci.html) and [Introducing `npm ci` for faster, more reliable builds](https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable). +This example installs the versions in the `package-lock.json` or `npm-shrinkwrap.json` file and prevents updates to the lock file. Using `npm ci` is generally faster than running `npm install`. For more information, see [`npm ci`](https://docs.npmjs.com/cli/ci.html) and [Introducing `npm ci` for faster, more reliable builds](https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable). ```yaml copy steps: @@ -167,7 +167,7 @@ steps: run: npm ci ``` -Using `npm install` installs the dependencies defined in the _package.json_ file. For more information, see [`npm install`](https://docs.npmjs.com/cli/install). +Using `npm install` installs the dependencies defined in the `package.json` file. For more information, see [`npm install`](https://docs.npmjs.com/cli/install). ```yaml copy steps: @@ -182,7 +182,7 @@ steps: ### Example using Yarn -This example installs the dependencies defined in the _yarn.lock_ file and prevents updates to the _yarn.lock_ file. For more information, see [`yarn install`](https://yarnpkg.com/en/docs/cli/install). +This example installs the dependencies defined in the `yarn.lock` file and prevents updates to the `yarn.lock` file. For more information, see [`yarn install`](https://yarnpkg.com/en/docs/cli/install). ```yaml copy steps: @@ -195,7 +195,7 @@ steps: run: yarn --frozen-lockfile ``` -Alternatively, you can install the dependencies defined in the _package.json_ file. +Alternatively, you can install the dependencies defined in the `package.json` file. ```yaml copy steps: @@ -214,9 +214,9 @@ steps: To authenticate to your private registry, you'll need to store your npm authentication token as a secret. For example, create a repository secret called `NPM_TOKEN`. For more information, see [AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions). -In the example below, the secret `NPM_TOKEN` stores the npm authentication token. The `setup-node` action configures the _.npmrc_ file to read the npm authentication token from the `NODE_AUTH_TOKEN` environment variable. When using the `setup-node` action to create an _.npmrc_ file, you must set the `NODE_AUTH_TOKEN` environment variable with the secret that contains your npm authentication token. +In the example below, the secret `NPM_TOKEN` stores the npm authentication token. The `setup-node` action configures the `.npmrc` file to read the npm authentication token from the `NODE_AUTH_TOKEN` environment variable. When using the `setup-node` action to create an `.npmrc` file, you must set the `NODE_AUTH_TOKEN` environment variable with the secret that contains your npm authentication token. -Before installing dependencies, use the `setup-node` action to create the _.npmrc_ file. The action has two input parameters. The `node-version` parameter sets the Node.js version, and the `registry-url` parameter sets the default registry. If your package registry uses scopes, you must use the `scope` parameter. For more information, see [`npm-scope`](https://docs.npmjs.com/misc/scope). +Before installing dependencies, use the `setup-node` action to create the `.npmrc` file. The action has two input parameters. The `node-version` parameter sets the Node.js version, and the `registry-url` parameter sets the default registry. If your package registry uses scopes, you must use the `scope` parameter. For more information, see [`npm-scope`](https://docs.npmjs.com/misc/scope). ```yaml copy steps: @@ -234,7 +234,7 @@ steps: NODE_AUTH_TOKEN: {% raw %}${{ secrets.NPM_TOKEN }}{% endraw %} ``` -The example above creates an _.npmrc_ file with the following contents: +The example above creates an `.npmrc` file with the following contents: ```shell //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} @@ -296,7 +296,7 @@ If you have a custom requirement or need finer controls for caching, you can use ## Building and testing your code -You can use the same commands that you use locally to build and test your code. For example, if you run `npm run build` to run build steps defined in your _package.json_ file and `npm test` to run your test suite, you would add those commands in your workflow file. +You can use the same commands that you use locally to build and test your code. For example, if you run `npm run build` to run build steps defined in your `package.json` file and `npm test` to run your test suite, you would add those commands in your workflow file. ```yaml copy steps: diff --git a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-python.md b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-python.md index 9efa3a6c6614..bcf371960133 100644 --- a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-python.md +++ b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-python.md @@ -233,7 +233,7 @@ steps: ### Requirements file -After you update `pip`, a typical next step is to install dependencies from _requirements.txt_. For more information, see [pip](https://pip.pypa.io/en/stable/cli/pip_install/#example-requirements-file). +After you update `pip`, a typical next step is to install dependencies from `requirements.txt`. For more information, see [pip](https://pip.pypa.io/en/stable/cli/pip_install/#example-requirements-file). ```yaml copy steps: diff --git a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-ruby.md b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-ruby.md index 13fce8eb0d88..2c7e7dcf1b74 100644 --- a/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-ruby.md +++ b/content/actions/use-cases-and-examples/building-and-testing/building-and-testing-ruby.md @@ -192,7 +192,7 @@ steps: {% endraw %} -This will configure bundler to install your gems to `vendor/cache`. For each successful run of your workflow, this folder will be cached by {% data variables.product.prodname_actions %} and re-downloaded for subsequent workflow runs. A hash of your gemfile.lock and the Ruby version are used as the cache key. If you install any new gems, or change a version, the cache will be invalidated and bundler will do a fresh install. +This will configure bundler to install your gems to `vendor/cache`. For each successful run of your workflow, this folder will be cached by {% data variables.product.prodname_actions %} and re-downloaded for subsequent workflow runs. A hash of your `gemfile.lock` and the Ruby version are used as the cache key. If you install any new gems, or change a version, the cache will be invalidated and bundler will do a fresh install. **Caching without setup-ruby** diff --git a/data/reusables/actions/setup-node-intro.md b/data/reusables/actions/setup-node-intro.md index 7a7baafb233f..beb91bcc188a 100644 --- a/data/reusables/actions/setup-node-intro.md +++ b/data/reusables/actions/setup-node-intro.md @@ -1 +1 @@ -You can use the `setup-node` action to create a local _.npmrc_ file on the runner that configures the default registry and scope. The `setup-node` action also accepts an authentication token as input, used to access private registries or publish node packages. For more information, see [`setup-node`](https://github.com/actions/setup-node/). +You can use the `setup-node` action to create a local `.npmrc` file on the runner that configures the default registry and scope. The `setup-node` action also accepts an authentication token as input, used to access private registries or publish node packages. For more information, see [`setup-node`](https://github.com/actions/setup-node/). From 6933714799f3643bb9d1a8667a01221fe1c08a83 Mon Sep 17 00:00:00 2001 From: Hasan Date: Mon, 27 Jan 2025 15:02:28 +0400 Subject: [PATCH 2/2] Added run keyword to example file triggering-a-workflow.md (#36061) --- .../triggering-a-workflow.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow.md b/content/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow.md index 0182b3de299f..9954f08eace8 100644 --- a/content/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow.md +++ b/content/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow.md @@ -294,7 +294,8 @@ jobs: runs-on: ubuntu-latest steps: - name: build - echo 'building' + run: | + echo 'building' publish: needs: [build] @@ -302,7 +303,8 @@ jobs: environment: production steps: - name: publish - echo 'publishing' + run: | + echo 'publishing' ``` > [!NOTE]