Skip to content

Commit

Permalink
fix: ok theres no if
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphe committed Sep 6, 2022
1 parent fd9aeb9 commit 2e4c458
Showing 1 changed file with 22 additions and 37 deletions.
59 changes: 22 additions & 37 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,35 @@ inputs:
description: "wether to publish pre-releases from PRs"
required: false
default: true
token:
gh_token:
description: "A Github PAT"
required: true
required: false
default: ${{ github.token }}
npm_token:
description: "token with which to publish to npm"
required: false
default: ${{ github.token }}

runs:
using: "composite"
steps:
- name: 👀 Inspect GitHub context
shell: bash
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: 👀 Inspect input
shell: bash
- shell: bash
env:
INPUTS: ${{ toJson(inputs) }}
run: echo "$INPUTS"

- name: 🗺 Prepare release
shell: bash
if: ${{ (inputs.add_config == true) }}
GITHUB_TOKEN: ${{ inputs.gh_token }}
NPM_TOKEN: ${{ inputs.npm_token }}
NODE_AUTH_TOKEN: ${{ inputs.npm_token }}
run: |
cd ${{ inputs.directory }}
cp ${{ github.action_path }}release.config.template.js ./release.config.js
- name: 🚀 Release
if: ${{ (github.event_name == 'push') }}
shell: bash
run: |
cd ${{ inputs.directory }}
npx semantic-release@19
env:
GITHUB_TOKEN: ${{ inputs.token }}
NPM_TOKEN: ${{ inputs.token }}
NODE_AUTH_TOKEN: ${{ inputs.token }}
if [ "${{inputs.add_config}}" == "true" ]; then
cp ${{ github.action_path }}release.config.template.js ./release.config.js
fi
- name: 🛫 Pre-Release
if: ${{ (inputs.pre_release == true) && (github.event_name == 'pull_request') }}
shell: bash
run: |
cd ${{ inputs.directory }}
yarn add decorate-gh-pr -D &&
npx semantish-prerelease@4 --release-pr
env:
GITHUB_TOKEN: ${{ inputs.token }}
NPM_TOKEN: ${{ inputs.token }}
NODE_AUTH_TOKEN: ${{ inputs.token }}
if [ "${{github.event_name}}" == "push" ]; then
npx semantic-release@19
fi
if [ "${{github.event_name}}" == "pull_request" && "${{inputs.pre_release}}" == "true" ]; then
npm i decorate-gh-pr -D &&
npx semantish-prerelease@4 --release-pr
fi

0 comments on commit 2e4c458

Please sign in to comment.