Skip to content

Commit

Permalink
Fix behavior for create-args without env name (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw authored Sep 4, 2023
1 parent 2b72821 commit cb27a03
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
8 changes: 0 additions & 8 deletions .github/labeler.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ jobs:
pr-label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
if: github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'edited' || github.event.action == 'synchronize'
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
id: labeler
- uses: mheap/github-action-required-labels@v5
if: steps.labeler.outputs.new-labels == ''
with:
labels: bug,enhancement,ci,documentation,dependencies,ignore-for-release
mode: minimum
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,18 @@ jobs:
id: setup-micromamba
- run: |
test "${{ steps.setup-micromamba.outputs.environment-path }}" = ""
# not properly testable
# https://github.com/actions/runner/issues/2347
# https://github.com/orgs/community/discussions/15452
# create-args-no-env-name:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: ./
# with:
# create-args: >-
# python
# pytest
# - run: exit 1
# if: success()
3 changes: 3 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/post.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ const validateInputs = (inputs: Inputs): void => {
if (inputs.initShell?.includes('none') && inputs.initShell.length !== 1) {
throw new Error("You cannot specify 'none' with other shells.")
}
if (!inputs.environmentName && !inputs.environmentFile && inputs.createArgs?.length) {
throw new Error('You need to specify an environment name.')
}
}

const assertOptions = (options: Options) => {
Expand Down

0 comments on commit cb27a03

Please sign in to comment.