-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from salesforcecli/ew/update-actions
Update external actions
- Loading branch information
Showing
16 changed files
with
115 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: get-json-property | ||
description: Get a property from a json file using jq | ||
|
||
# Examples: | ||
# prop_path: version | ||
# prop_path: devDependencies["@salesforce/dev-scripts"] | ||
|
||
|
||
inputs: | ||
path: | ||
required: true | ||
description: Json file to look up prop (package.json) | ||
prop_path: | ||
required: true | ||
description: jq query to search (version) | ||
|
||
outputs: | ||
prop: | ||
description: The value of the prop_path | ||
value: ${{ steps.jq.outputs.prop }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get property from json file | ||
id: jq | ||
shell: bash | ||
run: | | ||
PROP=$(jq -r '.${{ inputs.prop_path }}' ${{ inputs.path }}) | ||
echo "prop=$PROP" >> "$GITHUB_OUTPUT" | ||
- name: Exit if prop was not found | ||
if: ${{ steps.jq.outputs.prop == 'null' }} | ||
uses: actions/github-script@v7 | ||
with: | ||
script: core.setFailed("Property '${{ inputs.prop_path }}' not found in ${{ inputs.path }}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Parse Semver | ||
|
||
description: Extracts major, minor, patch, prerelease, and full version from a given semver. | ||
|
||
inputs: | ||
input_string: | ||
description: 'The semver version to parse' | ||
required: true | ||
|
||
outputs: | ||
major: | ||
description: 'MAJOR part of the semver' | ||
value: ${{ steps.parse.outputs.major }} | ||
minor: | ||
description: 'MINOR part of the semver' | ||
value: ${{ steps.parse.outputs.minor }} | ||
patch: | ||
description: 'PATCH part of the semver' | ||
value: ${{ steps.parse.outputs.patch }} | ||
prerelease: | ||
description: 'Prerelease part of the semver' | ||
value: ${{ steps.parse.outputs.prerelease }} | ||
fullversion: | ||
description: 'Full representation of the semver' | ||
value: ${{ steps.parse.outputs.fullversion }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Parse Semver | ||
id: parse | ||
shell: bash | ||
run: | | ||
FULL_VERSION="${{ inputs.version }}" | ||
VERSION="${FULL_VERSION#v}" | ||
# Split version into parts | ||
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" | ||
# Check if PATCH contains prerelease info and extract it | ||
if [[ "$PATCH" == *-* ]]; then | ||
PRERELEASE=$(echo "$PATCH" | cut -d- -f2 | cut -d. -f1) | ||
PATCH=$(echo "$PATCH" | cut -d- -f1) | ||
fi | ||
# Set outputs | ||
echo "major=$MAJOR" >> "$GITHUB_OUTPUT" | ||
echo "minor=$MINOR" >> "$GITHUB_OUTPUT" | ||
echo "patch=$PATCH" >> "$GITHUB_OUTPUT" | ||
echo "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT" | ||
echo "fullversion=$FULL_VERSION" >> "$GITHUB_OUTPUT" | ||
- name: Exit if major, minor, or patch not found | ||
if: ${{ !steps.parse.outputs.major || !steps.parse.outputs.minor || !steps.parse.outputs.patch }} | ||
uses: actions/github-script@v7 | ||
with: | ||
script: core.setFailed("Error parsing semver ${{ inputs.version }}\nMajor:${{ steps.parse.outputs.major }}\nMinor:${{ steps.parse.outputs.minor }}\nPatch:${{ steps.parse.outputs.patch }}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters