Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@ on:
- '**/*'

jobs:
test:
test-report-deploy-with-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Report Deploy with Docker
- name: Report Deploy with CLI
uses: ./
with:
integration_url: ${{ secrets.OL_TEST_DEPLOY_URL }}
service: "report_deploy_github_action"
use_docker: "true"
- name: Report Deploy with CLI
uses: ./

test-report-deploy-with-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Report Deploy with Docker
uses: ./with-docker
with:
integration_url: ${{ secrets.OL_TEST_DEPLOY_URL }}
service: "report_deploy_github_action"
use_docker: "false"
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@

This action emits a deploy event for service to OpsLevel. We have configured it with sane defaults so you should only have to specify `integration_url` and `service`. `environment` defaults to `production` so if you want to track deploys from other environments you'll want to specify that too.

## Example usage
## Example usage - uses OpsLevel CLI directly

```yaml
jobs:
deploy:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Report Deploy
uses: OpsLevel/report-deploy-github-action@v2.0.0
- name: Report Deploy using OpsLevel CLI
uses: OpsLevel/report-deploy-github-action@v3.0.0
with:
integration_url: ${{ secrets.DEPLOY_INTEGRATION_URL }}
service: "my-service"
```

## Example usage - uses Docker image

```yaml
jobs:
deploy:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Report Deploy using Docker
uses: OpsLevel/report-deploy-github-action/with-docker@v3.0.0
with:
integration_url: ${{ secrets.DEPLOY_INTEGRATION_URL }}
service: "my-service"
use_docker: "true"
```

## Inputs
Expand Down Expand Up @@ -60,17 +74,16 @@ The deploy url that OpsLevel points to - Default: `${{ github.server_url }}/${{

An identifier that can be used to deduplicate deployments - Default: `${{ github.run_id }}`

### `use_docker`
## Reporting Deploy with Docker or OpsLevel CLI

Send deploy using Docker container if "true" - use OpsLevel CLI otherwise - Default: `true`
This action can be run using either Docker or the OpsLevel CLI, both have identical inputs and behave identically.

## Reporting Deploy with Docker or OpsLevel CLI
To report deploys to OpsLevel with the OpsLevel CLI based Github Action (default), add `uses: OpsLevel/report-deploy-github-action@v3.0.0` to your workflow.

This action can be run using either Docker or the OpsLevel CLI, depending on the value of the `use_docker` input.
To report deploys to OpsLevel with the Docker based Github Action, add `uses: OpsLevel/report-deploy-github-action/with-docker@v3.0.0` to your workflow.

While both behave identically, this action will run using Docker by default - see [./with-docker](./with-docker).
For Github workflows operating within intentional constraints, perhaps where building public Docker images is not
an option, it may be preferable to use the OpsLevel CLI.
an option, it may be preferable to use the default OpsLevel CLI.

## Overriding Defaults Example

Expand All @@ -88,7 +101,7 @@ jobs:
DEPLOYER=$(git show -s --format='%ae')
echo "DEPLOYER=${DEPLOYER}" >> $GITHUB_OUTPUT
- name: Report Deploy
uses: OpsLevel/report-deploy-github-action@v2.0.0
uses: OpsLevel/report-deploy-github-action@v3.0.0
with:
integration_url: ${{ secrets.DEPLOY_INTEGRATION_URL }}
service: "my-service"
Expand Down
23 changes: 2 additions & 21 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,18 @@ inputs:
description: 'The service alias for the event'
required: false
default: ${{ github.repository }}
use_docker:
description: 'Send deploy using docker if "true" - use OpsLevel CLI otherwise'
required: false
default: 'true'
runs:
using: "composite"
steps:
- name: Install OpsLevel CLI
uses: opslevel/actions/setup-cli@v1
- name: Mask inputs
shell: bash
run: |
set +v
echo ::add-mask::${{ inputs.integration_url }}
set -v
- name: Do it with Docker
if: ${{ inputs.use_docker == 'true' }}
uses: OpsLevel/report-deploy-github-action/with-docker@v2.0.0
with:
integration_url: ${{ inputs.integration_url }}
deduplication_id: ${{ inputs.deduplication_id }}
deployer_email: ${{ inputs.deployer_email }}
deploy_url: ${{ inputs.deploy_url }}
deployer_name: ${{ inputs.deployer_name }}
description: ${{ inputs.description }}
environment: ${{ inputs.environment }}
number: ${{ inputs.number }}
service: ${{ inputs.service }}
- name: Install OpsLevel CLI
if: ${{ inputs.use_docker != 'true' }}
uses: opslevel/actions/setup-cli@v1
- name: Report Deploy to OpsLevel
if: ${{ inputs.use_docker != 'true' }}
shell: bash
run: |
cat <<EOF > data.yaml
Expand Down
Loading