|
| 1 | +# cf. Creating a composite action - GitHub Docs https://docs.github.com/en/actions/creating-actions/creating-a-composite-action |
| 2 | +# cf. Metadata syntax for GitHub Actions - GitHub Docs https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-actions |
| 3 | + |
| 4 | +name: ccc-actions |
| 5 | +description: Run ccc - Cloud Cost Checker https://github.com/kunitsuinc/ccc |
| 6 | +author: 'kunitsuinc' |
| 7 | + |
| 8 | +branding: |
| 9 | + icon: search |
| 10 | + color: gray-dark |
| 11 | + |
| 12 | +inputs: |
| 13 | + VERSION: |
| 14 | + description: 'ccc version for workflow (default "latest")' |
| 15 | + required: false |
| 16 | + default: 'latest' |
| 17 | + TZ: |
| 18 | + description: 'Time Zone for BigQuery (default "UTC")' |
| 19 | + required: false |
| 20 | + default: 'UTC' |
| 21 | + GOOGLE_CLOUD_PROJECT: |
| 22 | + description: 'Google Cloud Project ID' |
| 23 | + required: true |
| 24 | + GCP_BILLING_TABLE: |
| 25 | + description: 'GCP Billing export BigQuery Table name like: project-id.dataset_id.gcp_billing_export_v1_FFFFFF_FFFFFF_FFFFFF' |
| 26 | + required: true |
| 27 | + GCP_BILLING_PROJECT: |
| 28 | + description: 'Project ID in GCP Billing export BigQuery Table' |
| 29 | + required: true |
| 30 | + DAYS: |
| 31 | + description: 'Days for BigQuery (default 30)' |
| 32 | + required: false |
| 33 | + default: '30' |
| 34 | + IMAGE_FORMAT: |
| 35 | + description: 'Image Format (default "png")' |
| 36 | + required: false |
| 37 | + default: 'png' |
| 38 | + MESSAGE: |
| 39 | + description: 'Slack Message (Quoted)' |
| 40 | + required: false |
| 41 | + default: '' |
| 42 | + SLACK_TOKEN: |
| 43 | + description: 'Slack OAuth Token like: xoxb-999999999999-9999999999999-ZZZZZZZZZZZZZZZZZZZZZZZZ' |
| 44 | + required: true |
| 45 | + SLACK_CHANNEL: |
| 46 | + description: 'Slack Channel name (Bot must have already been invited)' |
| 47 | + required: true |
| 48 | + DEBUG: |
| 49 | + description: 'Debug flag' |
| 50 | + required: false |
| 51 | + default: 'false' |
| 52 | + |
| 53 | +runs: |
| 54 | + using: 'composite' |
| 55 | + steps: |
| 56 | + - name: Run ccc - Cloud Cost Checker |
| 57 | + shell: 'bash' |
| 58 | + env: |
| 59 | + DEBUG: ${{ inputs.DEBUG }} |
| 60 | + TZ: ${{ inputs.TZ }} |
| 61 | + GOOGLE_CLOUD_PROJECT: ${{ inputs.GOOGLE_CLOUD_PROJECT }} |
| 62 | + GCP_BILLING_TABLE: ${{ inputs.GCP_BILLING_TABLE }} |
| 63 | + GCP_BILLING_PROJECT: ${{ inputs.GCP_BILLING_PROJECT }} |
| 64 | + DAYS: ${{ inputs.DAYS }} |
| 65 | + IMAGE_FORMAT: ${{ inputs.IMAGE_FORMAT }} |
| 66 | + MESSAGE: ${{ inputs.MESSAGE }} |
| 67 | + SLACK_TOKEN: ${{ inputs.SLACK_TOKEN }} |
| 68 | + SLACK_CHANNEL: ${{ inputs.SLACK_CHANNEL }} |
| 69 | + run: | |
| 70 | + set -x |
| 71 | + env |
| 72 | + ${{ github.action_path }}/${{ inputs.VERSION }}/bin/ccc |
0 commit comments