Skip to content

Commit

Permalink
feat: Add conditional secrets export based on repository type
Browse files Browse the repository at this point in the history
  • Loading branch information
esloch committed May 9, 2023
1 parent f4953d9 commit b007445
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ env:
HOST_GID: 1000
_AIRFLOW_WWW_USER_USERNAME: ci
_AIRFLOW_WWW_USER_PASSWORD: ci
PSQL_USER_MAIN: ${{ secrets.CI_PSQL_USER }}
PSQL_PASSWORD_MAIN: ${{ secrets.CI_PSQL_PASSWORD }}
PSQL_HOST_MAIN: ${{ secrets.CI_PSQL_HOST }}
PSQL_PORT_MAIN: ${{ secrets.CI_PSQL_PORT }}
PSQL_DB_MAIN: ${{ secrets.CI_PSQL_DB }}
# PSQL_USER_MAIN: ${{ secrets.CI_PSQL_USER }}
# PSQL_PASSWORD_MAIN: ${{ secrets.CI_PSQL_PASSWORD }}
# PSQL_HOST_MAIN: ${{ secrets.CI_PSQL_HOST }}
# PSQL_PORT_MAIN: ${{ secrets.CI_PSQL_PORT }}
# PSQL_DB_MAIN: ${{ secrets.CI_PSQL_DB }}

jobs:
main:
Expand All @@ -36,6 +36,23 @@ jobs:
steps:
- uses: actions/checkout@v3

# Check if the repository is a fork
- name: Check if repository is a fork
run: |
if [[ "${{ github.event.repository.fork }}" == "true" ]]; then
export PSQL_USER_MAIN="${{ secrets.CI_PSQL_USER_FORK }}"
export PSQL_PASSWORD_MAIN="${{ secrets.CI_PSQL_PASSWORD_FORK }}"
export PSQL_HOST_MAIN="${{ secrets.CI_PSQL_HOST_FORK }}"
export PSQL_PORT_MAIN="${{ secrets.CI_PSQL_PORT_FORK }}"
export PSQL_DB_MAIN="${{ secrets.CI_PSQL_DB_FORK }}"
else
export PSQL_USER_MAIN="${{ secrets.CI_PSQL_USER }}"
export PSQL_PASSWORD_MAIN="${{ secrets.CI_PSQL_PASSWORD }}"
export PSQL_HOST_MAIN="${{ secrets.CI_PSQL_HOST }}"
export PSQL_PORT_MAIN="${{ secrets.CI_PSQL_PORT }}"
export PSQL_DB_MAIN="${{ secrets.CI_PSQL_DB }}"
fi
- name: Semantic Release Title Check
uses: osl-incubator/semantic-release-pr-title-check@v1.4.1
with:
Expand All @@ -54,7 +71,6 @@ jobs:

- name: Create environment variables file
run: |
export AIRFLOW_UID=$(id -u)
envsubst < env.tpl > .env
- name: Lint All Files
Expand Down

0 comments on commit b007445

Please sign in to comment.