-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e16f444
commit 01660ff
Showing
2 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Delete Deployments | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
find-old-deployments: | ||
name: Get deployments for this PR | ||
runs-on: ubuntu-latest | ||
outputs: | ||
items: ${{ steps.list_deployments.outputs.data }} | ||
steps: | ||
- name: list deployments | ||
id: list_deployments | ||
uses: octokit/request-action@v2.x | ||
with: | ||
route: GET /repos/:repository/deployments | ||
repository: ${{ github.repository }} | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
delete-old-deployments: | ||
name: Inactivate deployment | ||
runs-on: ubuntu-latest | ||
needs: | ||
- find-old-deployments | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
item: ${{ fromJSON(needs.find-old-deployments.outputs.items) }} | ||
steps: | ||
- name: set deployments inactive | ||
id: inactivate_deployments | ||
uses: octokit/request-action@v2.x | ||
with: | ||
route: DELETE /repos/:repository/deployments/:deployment_id | ||
repository: ${{ github.repository }} | ||
deployment_id: ${{ matrix.item.id }} | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters