[bitnami/charts] Fix workflow issues with existing cards (#14429)

Signed-off-by: Fran Mulero <fmulero@vmware.com>
This commit is contained in:
Fran Mulero
2023-01-19 13:11:08 +01:00
committed by GitHub
parent f02f4e2319
commit 8dc48fd0fa

View File

@@ -19,20 +19,21 @@ jobs:
with:
path: .github/workflows/
- uses: actions/github-script@v6
script: |
const cards = await github.rest.projects.listCards({
column_id: ${{ env.SOLVED_COLUMN_ID }},
archived_state: all,
per_page: 100
});
// Remove cards without updates in last week.
const comparedDate = new Date();
comparedDate.setDate(comparedDate.getDate() - 7);
cards.forEach(card => {
const lastUpdate = new Date(card.updated_at);
if (card.archived || lastUpdate < comparedDate ) {
github.rest.projects.deleteCard({
card_id: card.id
});
}
});
with:
script: |
const cards = await github.rest.projects.listCards({
column_id: ${{ env.SOLVED_COLUMN_ID }},
archived_state: all,
per_page: 100
});
// Remove cards without updates in last week.
const comparedDate = new Date();
comparedDate.setDate(comparedDate.getDate() - 7);
cards.forEach(card => {
const lastUpdate = new Date(card.updated_at);
if (card.archived || lastUpdate < comparedDate ) {
github.rest.projects.deleteCard({
card_id: card.id
});
}
});