Skip to content

Commit

Permalink
feat: v1
Browse files Browse the repository at this point in the history
  • Loading branch information
jaironalves committed Jun 13, 2024
1 parent 72043a8 commit 474f8b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,15 @@ jobs:

- name: Run the Container
id: run
env:
INPUT_WHO_TO_GREET: Mona Lisa Octocat
INPUT_YAML_FILE_PATH: ./yq-test.yml
#GITHUB_OUTPUT: /github/file_commands/output_temp --env GITHUB_OUTPUT="${{ env.GITHUB_OUTPUT }}" \
env:
INPUT_YAML_FILE_PATH: ./yq-test.yml
run: |
echo "$GITHUB_OUTPUT"
docker run \
--workdir /github/workspace \
--volume "${{ github.workspace }}":"/github/workspace" \
--volume "${{ runner.temp }}/_runner_file_commands":"${{ runner.temp }}/_runner_file_commands" \
--env GITHUB_OUTPUT="$GITHUB_OUTPUT" \
--env INPUT_WHO_TO_GREET="${{ env.INPUT_WHO_TO_GREET }}" \
--env GITHUB_OUTPUT="$GITHUB_OUTPUT" \
--env INPUT_YAML_FILE_PATH="${{ env.INPUT_YAML_FILE_PATH }}" \
--rm ${{ env.TEST_TAG }}
Expand All @@ -76,8 +73,7 @@ jobs:
- name: Test Local Action
id: test-action
uses: ./
with:
who-to-greet: Mona Lisa Octocat
with:
file-path: ./yq-test.yml

- name: Print Output
Expand Down
7 changes: 1 addition & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@ _replace_dots() {

set -e

echo $GITHUB_OUTPUT

# Read the file using yq
yq -o p --properties-separator ':' '... comments = ""' "$INPUT_YAML_FILE_PATH"

_properties=$(_yaml_to_properties "$INPUT_YAML_FILE_PATH")
_parsed_properties=$(_replace_dots "$properties" "_")

# Use INPUT_<INPUT_NAME> to get the value of an input
GREETING="Hello, $INPUT_WHO_TO_GREET!"

# Use workflow commands to do things like set debug messages
echo "::notice file=entrypoint.sh,line=7::$GREETING"
echo "::notice file=entrypoint.sh,line=23::$GREETING"

Check notice on line 23 in entrypoint.sh

View workflow job for this annotation

GitHub Actions / GitHub Actions Test

Hello, World!

# Write outputs to the $GITHUB_OUTPUT file
echo "time=$(date)" >>"$GITHUB_OUTPUT"
Expand Down

0 comments on commit 474f8b2

Please sign in to comment.