Skip to content

Commit

Permalink
chore: fix deployment clearing and url setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bizzonium committed Nov 9, 2023
1 parent b554bd5 commit d145171
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ jobs:
- name: Delete Previous deployments
uses: actions/github-script@v6
env:
GITHUB_BRANCH: ${{ vars.BRANCH }}
GITHUB_SHA_HEAD: ${{ github.sha }}
with:
script: |
const { GITHUB_BRANCH } = process.env
const { GITHUB_SHA_HEAD } = process.env
const deployments = await github.rest.repos.listDeployments({
owner: context.repo.owner,
repo: context.repo.repo,
ref: GITHUB_BRANCH
sha: GITHUB_SHA_HEAD
});
await Promise.all(
deployments.data.map(async (deployment) => {
deployments.data.filter((d) => d.performed_via_github_app === null).map(async (deployment) => {
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down Expand Up @@ -244,6 +244,7 @@ jobs:
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "success"

Expand All @@ -253,5 +254,6 @@ jobs:
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "failure"

0 comments on commit d145171

Please sign in to comment.