Skip to content

Commit

Permalink
AAE-23145 Documentation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-piotrowiak committed Jun 18, 2024
1 parent 07ec0bb commit 3eb73bd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/actions/env-load-from-yaml/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "env-load-from-yaml"
description: "Load environment variables from a yaml file"
inputs:
ignore_regex:
description: "Bash regex to ignore certain lines"
required: false
default: ^$
yml_path:
description: "Path to the yaml file to parse"
required: true
runs:
using: "composite"
steps:
- name: Parse env global
run: |
while read ENVVAR; do
if [[ "$ENVVAR" =~ ${{ inputs.ignore_regex }} ]]; then
echo "Skipping unwanted $ENVVAR"
continue
fi
eval $ENVVAR
echo "$(eval echo $ENVVAR)" >> $GITHUB_ENV
done < <(yq '.env.global[]' ${{ inputs.yml_path }})
shell: bash
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Here follows the list of GitHub Actions topics available in the current document
- [docker-dump-containers-logs](#docker-dump-containers-logs)
- [docker-scan-image-dirs](#docker-scan-image-dirs)
- [enforce-pr-conventions](#enforce-pr-conventions)
- [env-load-from-yaml](#env-load-from-yaml)
- [free-hosted-runner-disk-space](#free-hosted-runner-disk-space)
- [get-branch-name](#get-branch-name)
- [get-build-info](#get-build-info)
Expand Down Expand Up @@ -504,6 +505,17 @@ Examples:

❌ JKEY-12345 the title of the Merge Commit

### env-load-from-yaml

Load environment variables from a yaml file

```yaml
- uses: Alfresco/alfresco-build-tools/.github/actions/env-load-from-yaml@ref
with:
ignore_regex: ^BRANCH_NAME=.*
yml_path: .travis/env.yml
```

### free-hosted-runner-disk-space

Removes unnecessary folders and files from a GHA [hosted runner](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners), and if that is not enough, allows to manipulate and utilize unused memory partitions. This action might be useful when we run jobs which require a lot of disk space.
Expand Down

0 comments on commit 3eb73bd

Please sign in to comment.