From b38c393af014a4730471d7a58c55bf9a88d80947 Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Wed, 31 Aug 2022 10:36:03 -0500 Subject: [PATCH 1/4] Revert "Use valid reusable workflow paths in example yml" This reverts commit c9186d07c3681362b9707d6a88f8678cee8ab3b1. --- content/actions/using-workflows/reusing-workflows.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/actions/using-workflows/reusing-workflows.md b/content/actions/using-workflows/reusing-workflows.md index bbdf28e7fee3..10ac5871e073 100644 --- a/content/actions/using-workflows/reusing-workflows.md +++ b/content/actions/using-workflows/reusing-workflows.md @@ -127,7 +127,7 @@ You can define inputs and secrets, which can be passed from the caller workflow runs-on: ubuntu-latest environment: production steps: - - uses: ./.github/workflows/my-action + - uses: ./.github/actions/my-action with: username: ${{ inputs.username }} token: ${{ secrets.envPAT }} @@ -168,7 +168,7 @@ jobs: name: Pass input and secrets to my-action runs-on: ubuntu-latest steps: - - uses: ./.github/workflows/my-action + - uses: ./.github/actions/my-action with: username: ${{ inputs.username }} token: ${{ secrets.token }} From 8355fe88f9e7c088091c8ddf2532d12860cf865b Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Wed, 31 Aug 2022 10:56:41 -0500 Subject: [PATCH 2/4] adding note about using a local action --- content/actions/using-workflows/reusing-workflows.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/actions/using-workflows/reusing-workflows.md b/content/actions/using-workflows/reusing-workflows.md index 10ac5871e073..993ffd9adf83 100644 --- a/content/actions/using-workflows/reusing-workflows.md +++ b/content/actions/using-workflows/reusing-workflows.md @@ -127,6 +127,7 @@ You can define inputs and secrets, which can be passed from the caller workflow runs-on: ubuntu-latest environment: production steps: + # References a local action - uses: ./.github/actions/my-action with: username: ${{ inputs.username }} @@ -147,7 +148,7 @@ You can define inputs and secrets, which can be passed from the caller workflow ### Example reusable workflow -This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in an action. +This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in a [local action in the same repository](/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-in-the-same-repository-as-the-workflow) as the reusable workflow. {% raw %} ```yaml{:copy} @@ -168,12 +169,14 @@ jobs: name: Pass input and secrets to my-action runs-on: ubuntu-latest steps: + # References a local action - uses: ./.github/actions/my-action with: username: ${{ inputs.username }} token: ${{ secrets.token }} ``` {% endraw %} + {% ifversion actions-reusable-workflow-matrix %} ## Using a matrix strategy with a reusable workflow From a41a24f49cc8c1f74909c627c594a2c0223cb31f Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Wed, 31 Aug 2022 11:13:43 -0500 Subject: [PATCH 3/4] removing the local action reference entirely --- content/actions/using-workflows/reusing-workflows.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/content/actions/using-workflows/reusing-workflows.md b/content/actions/using-workflows/reusing-workflows.md index 993ffd9adf83..d5ed7369befa 100644 --- a/content/actions/using-workflows/reusing-workflows.md +++ b/content/actions/using-workflows/reusing-workflows.md @@ -127,8 +127,7 @@ You can define inputs and secrets, which can be passed from the caller workflow runs-on: ubuntu-latest environment: production steps: - # References a local action - - uses: ./.github/actions/my-action + - uses: my-org/my-action@main with: username: ${{ inputs.username }} token: ${{ secrets.envPAT }} @@ -148,7 +147,7 @@ You can define inputs and secrets, which can be passed from the caller workflow ### Example reusable workflow -This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in a [local action in the same repository](/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-in-the-same-repository-as-the-workflow) as the reusable workflow. +This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in an action. {% raw %} ```yaml{:copy} @@ -169,8 +168,7 @@ jobs: name: Pass input and secrets to my-action runs-on: ubuntu-latest steps: - # References a local action - - uses: ./.github/actions/my-action + - uses: my-org/my-action@main with: username: ${{ inputs.username }} token: ${{ secrets.token }} From 12ca61dc1a6ec34369281ae2ebb05d0655c74d5b Mon Sep 17 00:00:00 2001 From: Lucas Costi Date: Thu, 1 Sep 2022 13:53:05 +1000 Subject: [PATCH 4/4] Apply suggestions from code review --- content/actions/using-workflows/reusing-workflows.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/actions/using-workflows/reusing-workflows.md b/content/actions/using-workflows/reusing-workflows.md index d5ed7369befa..07bc6dd231fc 100644 --- a/content/actions/using-workflows/reusing-workflows.md +++ b/content/actions/using-workflows/reusing-workflows.md @@ -127,7 +127,7 @@ You can define inputs and secrets, which can be passed from the caller workflow runs-on: ubuntu-latest environment: production steps: - - uses: my-org/my-action@main + - uses: octo-org/my-action@v1 with: username: ${{ inputs.username }} token: ${{ secrets.envPAT }} @@ -168,7 +168,7 @@ jobs: name: Pass input and secrets to my-action runs-on: ubuntu-latest steps: - - uses: my-org/my-action@main + - uses: octo-org/my-action@v1 with: username: ${{ inputs.username }} token: ${{ secrets.token }}