Skip to content

Commit

Permalink
override CIRCLE_PROJECT_REPONAME by GITHUB_REPOSITORY env
Browse files Browse the repository at this point in the history
  • Loading branch information
datdao committed May 21, 2024
1 parent aaacae1 commit dbacace
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ jobs:
POSTGRES_USER: postgres
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
environment:
GITHUB_REPOSITORY: "ariga/atlas-orb"
steps:
- checkout
- atlas-orb/setup:
Expand All @@ -124,14 +126,15 @@ jobs:
working_directory: testdata
dir_name: my-cool-project
dev_url: postgres://postgres:pass@localhost:5432/test?sslmode=disable
repo: "ariga/atlas-orb"
- atlas-orb/migrate_push:
working_directory: testdata
dir_name: my-cool-project
dev_url: postgres://postgres:pass@localhost:5432/test?sslmode=disable
integration-test-lint:
docker:
- image: cimg/base:current
environment:
GITHUB_REPOSITORY: "ariga/atlas-orb"
steps:
- checkout
- atlas-orb/setup:
Expand All @@ -147,19 +150,16 @@ jobs:
dir_name: test-dir-sqlite
dir: "file://sqlite-broken-file"
dev_url: "sqlite://file.db?mode=memory"
repo: "ariga/atlas-orb"
- atlas-orb/migrate_lint:
working_directory: testdata
dir_name: test-dir-sqlite
dir: "file://sqlite-destructive"
dev_url: "sqlite://file.db?mode=memory"
repo: "ariga/atlas-orb"
- atlas-orb/migrate_lint:
working_directory: testdata
dir_name: test-dir-sqlite
dir: "file://sqlite-wrong-sum"
dev_url: "sqlite://file.db?mode=memory"
repo: "ariga/atlas-orb"
workflows:
test-deploy:
jobs:
Expand Down
12 changes: 6 additions & 6 deletions src/commands/migrate_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ parameters:
default: ''
description: |
The environment to use from the Atlas configuration file. For example, `dev`.
repo:
type: string
default: ''
github_repo_env:
type: env_var_name
default: GITHUB_REPOSITORY
description: |
The repository name that linting results will be posted to.
github_token_env:
Expand All @@ -63,9 +63,9 @@ steps:
INPUT_VARS: <<parameters.vars>>
INPUT_DEV_URL: <<parameters.dev_url>>
command: |
# replace CIRCLE_PROJECT_REPONAME with the repo if provided
if [ -n "<<parameters.repo>>" ]; then
CIRCLE_PROJECT_REPONAME=<<parameters.repo>>
# replace GITHUB_REPOSITORY with the github_repo_env if provided
if [ -n "${<<parameters.github_repo_env>>}" ]; then
GITHUB_REPOSITORY=${<<parameters.github_repo_env>>}
fi
# replace GITHUB_TOKEN with the github_token_env if provided
if [ -n "${<<parameters.github_token_env>>}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/examples/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ usage:
- atlas-orb/migrate_lint:
dir_name: my-cool-project
dev_url: "postgres://postgres:pass@localhost:5432/postgres?sslmode=disable"
repo: "ariga/atlas-orb"
github_repo_env: "GITHUB_REPOSITORY"
github_token_env: "GITHUB_TOKEN"
- atlas-orb/migrate_push:
dir_name: my-cool-project
Expand Down

0 comments on commit dbacace

Please sign in to comment.