@@ -115,7 +115,6 @@ jobs:
115
115
if : always()
116
116
permissions :
117
117
pull-requests : write # allow codenotify to comment on pull-request
118
- deployments : write # allow for cleanup
119
118
120
119
needs :
121
120
- build
@@ -137,32 +136,3 @@ jobs:
137
136
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
138
137
# https://github.com/sourcegraph/codenotify/issues/19
139
138
continue-on-error : true
140
-
141
- - name : Delete Previous deployments
142
- uses : actions/github-script@v6
143
- if : always()
144
- env :
145
- GITHUB_SHA_HEAD : ${{ github.event.pull_request.head.sha }}
146
- with :
147
- script : |
148
- const { GITHUB_SHA_HEAD } = process.env
149
- const deployments = await github.rest.repos.listDeployments({
150
- owner: context.repo.owner,
151
- repo: context.repo.repo,
152
- sha: GITHUB_SHA_HEAD
153
- });
154
- await Promise.all(
155
- deployments.data.map(async (deployment) => {
156
- await github.rest.repos.createDeploymentStatus({
157
- owner: context.repo.owner,
158
- repo: context.repo.repo,
159
- deployment_id: deployment.id,
160
- state: 'inactive'
161
- });
162
- return github.rest.repos.deleteDeployment({
163
- owner: context.repo.owner,
164
- repo: context.repo.repo,
165
- deployment_id: deployment.id
166
- });
167
- })
168
- );
0 commit comments