-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOT-1020 add remove test releases workflow (#1)
- Loading branch information
1 parent
e35393a
commit f5db57e
Showing
1 changed file
with
48 additions
and
0 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,48 @@ | ||
name: Remove Test Releases | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 2 * * 1 | ||
|
||
env: | ||
GIT_USER: "svc-dot-bot" | ||
GIT_EMAIL: "[email protected]" | ||
|
||
jobs: | ||
remove: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Config git | ||
run: | | ||
git config --global user.name "${{ env.GIT_USER }}" | ||
git config --global user.email "${{ env.GIT_EMAIL }}" | ||
- name: Checkout to gh-pages | ||
run: | | ||
git fetch | ||
git checkout gh-pages | ||
- name: remove test charts in index file | ||
run: | | ||
cat << EOF > index.yaml | ||
apiVersion: v1 | ||
entries: | ||
usage-engine-private-edition: | ||
generated: "2023-02-27T14:54:15.008712628Z" | ||
EOF | ||
git commit -am "clean up test charts" | ||
git push origin gh-pages | ||
- name: Remove test releases | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
gh release list --limit 1000 | | ||
awk '{print $1}' | | ||
xargs -I% gh release delete --yes --cleanup-tag % |