Skip to content

Commit

Permalink
*: add inputs.checkout
Browse files Browse the repository at this point in the history
Allows stacked actions to suppress a checkout step
  • Loading branch information
jsoref committed Feb 9, 2024
1 parent f525f68 commit 215f20e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
6 changes: 5 additions & 1 deletion deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ branding:
icon: 'upload-cloud'
color: 'purple'
inputs:
checkout:
description: Whether or not to checkout the repository you are currently working in
required: false
default: "true"
repository:
description: Repository containing deployment information
required: true
Expand Down Expand Up @@ -52,7 +56,7 @@ runs:
run: |
"$GITHUB_ACTION_PATH/../scripts/report-missing-inputs.pl"
- name: Prepare for deployment
if: env.BRANCH == env.DEFAULT_BRANCH || github.event.pull_request
if: (inputs.checkout == 'true') && (env.BRANCH == env.DEFAULT_BRANCH || github.event.pull_request)
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ inputs.default-branch }}
Expand Down
6 changes: 5 additions & 1 deletion release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ branding:
icon: 'upload-cloud'
color: 'orange'
inputs:
checkout:
description: Whether or not to checkout the repository you are currently working in
required: false
default: "true"
repository:
description: Repository containing test information
required: true
Expand Down Expand Up @@ -48,7 +52,7 @@ runs:
with:
needs-json: ${{ inputs.needs-json }}
- name: Prepare for E2E Deployment
if: env.BRANCH == env.DEFAULT_BRANCH || github.event.pull_request
if: (inputs.checkout == 'true') && (env.BRANCH == env.DEFAULT_BRANCH || github.event.pull_request)
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ inputs.default-branch }}
Expand Down
5 changes: 5 additions & 0 deletions scoverage/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Scoverage Report'
description: 'Generate Aggregate Scoverage Report'
inputs:
checkout:
description: Whether or not to checkout the repository you are currently working in
required: false
default: "true"
working-directory:
description: "Directory containing Scala projects with scoverage data to aggregate"
default: .
Expand Down Expand Up @@ -28,6 +32,7 @@ runs:
working-directory: ${{ inputs.working-directory }}

- name: Checkout
if: ${{ inputs.checkout == 'true' }}
uses: actions/checkout@v4
with:
path: ${{ inputs.working-directory }}
Expand Down
5 changes: 5 additions & 0 deletions yarn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ branding:
icon: 'aperture'
color: 'purple'
inputs:
checkout:
description: Whether or not to checkout the repository you are currently working in
required: false
default: "true"
npm-registry:
description: "The npm registry from which to retrieve packages"
default: "https://registry.npmjs.org/"
Expand Down Expand Up @@ -93,6 +97,7 @@ runs:
"$GITHUB_ACTION_PATH/../scripts/report-missing-inputs.pl"
- name: Checkout
if: ${{ inputs.checkout == 'true' }}
uses: actions/checkout@v4

- name: Enable corepack
Expand Down

0 comments on commit 215f20e

Please sign in to comment.