Set default

This commit is contained in:
zandercymatics 2023-12-05 12:11:52 -07:00
parent 99c2dc4de3
commit 20005b7140
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -3,24 +3,12 @@ run-name: Upload current-full.csv and current-federal.csv for branch ${{ github.
on:
pull_request:
workflow_dispatch:
inputs:
environment:
type: choice
description: Which environment do you wish to load reports for?
options:
- stable
- staging
- development
- za
schedule:
# Runs every day at 5 AM UTC.
- cron: "0 5 * * *"
jobs:
variables:
env:
DEFAULT_ENV: CF_REPORT_ENV
outputs:
environment: ${{ steps.var.outputs.environment}}
runs-on: "ubuntu-latest"
@ -30,7 +18,8 @@ jobs:
id: var
with:
script: |
const environment = (github && github.event && github.event.inputs) ? github.event.inputs.environment : ${{ secrets[env.DEFAULT_ENV] }};
const default = "CF_REPORT_ENV"
const environment = ${{ secrets[default] }};
core.setOutput('environment', environment);
upload-reports:
@ -39,6 +28,7 @@ jobs:
env:
CF_USERNAME: CF_${{ needs.variables.outputs.environment }}_USERNAME
CF_PASSWORD: CF_${{ needs.variables.outputs.environment }}_PASSWORD
CF_DEFAULT_ENV: CF_REPORT_ENV
steps:
- name: Generate current-federal.csv
uses: cloud-gov/cg-cli-tools@main