Skip to content

modernize and upgrade to node20 #1

modernize and upgrade to node20

modernize and upgrade to node20 #1

name: 'integration-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- master
jobs:
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: run_action
with:
key: 'keyB'
map: |
{
"keyA": {
"env1A": "value1A",
"env2A": "value2A",
"env3A": "value3A"
},
"...B": {
"env1B": "value1B",
"env2B": "value2B",
"env3B": "value3B"
},
".*": {
"env1C": "value1C",
"env2C": "value2C",
"env3C": "value3C"
}
}
export_to: log,env,output
- name: 'Test Actions Parameters'
run: |
test "${{env.env1B}}" = "value1B"
test "${{env.env2B}}" = "value2B"
test "${{env.env3B}}" = "value3B"
test "${{steps.run_action.outputs.env1B}}" = "value1B"
test "${{steps.run_action.outputs.env2B}}" = "value2B"
test "${{steps.run_action.outputs.env3B}}" = "value3B"
test-readme-example1:
runs-on: ubuntu-latest
steps:
- uses: kanga333/variable-mapper@master
with:
key: '${{github.base_ref}}'
map: |
{
"master": {
"environment": "production",
"AWS_ACCESS_KEY_ID": "${{ secrets.PROD_AWS_ACCESS_KEY_ID }}",
"AWS_SECRET_ACCESS_KEY": "${{ secrets.PROD_AWS_ACCESS_KEY_ID }}"
},
"staging": {
"environment": "staging",
"AWS_ACCESS_KEY_ID": "${{ secrets.STG_AWS_ACCESS_KEY_ID }}",
"AWS_SECRET_ACCESS_KEY": "${{ secrets.STG_AWS_ACCESS_KEY_ID }}"
},
".*": {
"environment": "development",
"AWS_ACCESS_KEY_ID": "${{ secrets.DEV_AWS_ACCESS_KEY_ID }}",
"AWS_SECRET_ACCESS_KEY": "${{ secrets.DEV_AWS_ACCESS_KEY_ID }}"
}
}
- name: Echo environment
run: echo ${{ env.environment }}
test-readme-example2:
runs-on: ubuntu-latest
steps:
- uses: kanga333/variable-mapper@master
id: export
with:
key: '${{github.base_ref}}'
map: |
{
"master": {
"environment": "production"
},
".*": {
"environment": "development"
}
}
export_to: env,log,output
- name: Echo environment and output
run: |
echo ${{ env.environment }}
echo ${{ steps.export.outputs.environment }}
test-readme-example3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: export
with:
key: 'first'
map: |
{
"first": {
"env1": "value1",
"env2": "value2"
},
".*": {
"env1": "value1_overwrite",
"env3": "value3"
}
}
export_to: env
mode: first_match
- name: Echo environment and output
run: |
test "${{ env.env1 }}" = "value1"
test "${{ env.env2 }}" = "value2"
test "${{ env.env3 }}" = ""
test-readme-example4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: export
with:
key: 'first'
map: |
{
"first": {
"env1": "value1",
"env2": "value2"
},
".*": {
"env1": "value1_overwrite",
"env3": "value3"
}
}
export_to: env
mode: overwrite
- name: Echo environment and output
run: |
test "${{ env.env1 }}" = "value1_overwrite"
test "${{ env.env2 }}" = "value2"
test "${{ env.env3 }}" = "value3"
test-readme-example5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: export
with:
key: 'first'
map: |
{
"first": {
"env1": "value1",
"env2": "value2"
},
".*": {
"env1": "value1_overwrite",
"env3": "value3"
}
}
export_to: env
mode: fill
- name: Echo environment and output
run: |
test "${{ env.env1 }}" = "value1"
test "${{ env.env2 }}" = "value2"
test "${{ env.env3 }}" = "value3"