Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input required and not supplied: deployment_id #161

Open
drewbietron opened this issue Jan 3, 2024 · 1 comment
Open

Input required and not supplied: deployment_id #161

drewbietron opened this issue Jan 3, 2024 · 1 comment

Comments

@drewbietron
Copy link

drewbietron commented Jan 3, 2024

I am updating this to version 1 and am having trouble with the deployment_id. I have tried many combinations of values for it and I cannot seem to get this to work. I have tried (or thought I did) what the docs explain, as well as trying other values. The closest I've got is just by hardcoding a value (eg 123) as the deployment_id, but that throws other errors.

Here is my current config

 steps:
      - uses: actions/checkout@v3
      - name: Start Web Preview Deployment
        uses: bobheadxi/deployments@v1
        id: deployment
        with:
          step: start
          token: ${{ secrets.GITHUB_TOKEN }}
          env: ${{ fromJSON('["Production", "Preview"]')[github.ref != 'refs/heads/main'] }}
          deployment_id: ${{ github.event.deployment.id }}
      - name: Web Preview Build
        uses: actions/setup-node@v1
        with:
          node-version: "14.x"
      - name: Deploy
        ... deploy steps
      - name: Update Web Preview Deployment Status
        uses: bobheadxi/deployments@v1
        if: always()
        with:
          step: finish
          token: ${{ secrets.GITHUB_TOKEN }}
          status: ${{ job.status }}
          env: ${{ fromJSON('["Production", "Preview"]')[github.ref != 'refs/heads/main'] }}
          deployment_id: ${{ github.event.deployment.id }}
          debug: true

The output for the debug is

Run bobheadxi/deployments@v1
  with:
    step: finish
    token: ***
    status: failure
    env: Preview
    debug: true
    auto_inactive: false

deployment_id isnt there. Its there if I hard code 123 but my suspicion is that what Im using for the deployment_id isnt a thing.

When I try a value that shows up in debug (eg deployment_id: ${{ github.ref }}), I get the following error

Preview: found 100 existing deployments for env
Preview.1251784709: setting deployment (1dd4c5b78a8100f2d44b56ef848fc652ce3bb144) state to "inactive"
Preview.1251784709 is already inactive; skipping.

Any help would be appreciated 🙏

@abivolmv
Copy link

Try using deployment_id: ${{ steps.deployment.outputs.deployment_id }}

      - name: update deployment status
        uses: bobheadxi/[email protected]
        if: always()
        with:
          step: finish
          token: ${{ secrets.GITHUB_TOKEN }}
          status: ${{ job.status }}
          deployment_id: ${{ steps.deployment.outputs.deployment_id }}
          env: ${{ steps.deployment.outputs.env }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants