-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move Foundry version detection to an action
- Loading branch information
Showing
3 changed files
with
35 additions
and
31 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
.github/actions/detect-solidity-foundry-version/action.yml
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,26 @@ | ||
name: 'Detect Foundry version in GNUmakefile' | ||
description: 'Detects Foundry version in GNUmakefile' | ||
inputs: | ||
working-directory: | ||
description: 'The GNUmakefile directory' | ||
required: false | ||
default: 'contracts' | ||
outputs: | ||
foundry-version: | ||
description: 'Foundry version found in GNUmakefile' | ||
value: ${{ steps.extract-foundry-version.outputs.foundry-version }} | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Extract Foundry version | ||
id: extract-foundry-version | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
foundry_version=$(grep -Eo "foundryup --version [^ ]+" GNUmakefile | awk '{print $3}') | ||
if [ -z "$foundry_version" ]; then | ||
echo "::error::Foundry version not found in GNUmakefile" | ||
exit 1 | ||
fi | ||
echo "Foundry version found: $foundry_version" | ||
echo "foundry-version=$foundry_version" >> $GITHUB_OUTPUT |
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