Azure / Azure/static-web-apps

GitHub Action: Close PR errors with deployment_token was not provided.

Open
#1,489 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Using the [azure/static-web-apps-deploy](https://github.com/Azure/static-web-apps-deploy) GitHub Action, on closed PR action the following error appears:

```
deployment_token was not provided.
The deployment_token is required for deploying content. If you'd like to continue the run without deployment, add the configuration skip_deploy_on_missing_secrets set to true in your workflow file
An unknown exception has occurred
```
This is preventing cleanup of the preview environments in the Static Web App.

**To Reproduce**
Steps to reproduce the behavior:
1. Add the following as a job in GitHub Actions:
```yml
close_pull_request_job:
name: Close Pull Request Job
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed'

steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
app_location: '.'
azure_static_web_apps_api_token: ${{ secrets.staticWebAppToken }}
action: "close"
```
2. Close PR to trigger
3. The above error appears

**Expected behavior**
PR to trigger on close and clean-up the preview environment

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.