Skip to content

Commit

Permalink
📅 Add scheduled maintenance workflow of Airflow Python Base Image (#6584
Browse files Browse the repository at this point in the history
)

* 📅 Add scheduled maintenance of Airflow Python Base Image

* 📝 typo

* 🔧 Rename file
  • Loading branch information
Gary-H9 authored Jan 22, 2025
1 parent 334d6f4 commit 453526f
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/schedule-issue-airflow-python-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: 📥 Maintenance - Create Airflow Python Base Issue

on:
schedule:
- cron: "0 8 1 * *" # UTC time: “At 08:00 on first day-of-month”

permissions: {}

jobs:
create-maintenance-issue:
name: Create Maintenance Issue
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create Maintenance Issue
id: create_maintenance_issue
run: |
if [[ "${CLOSE_PREVIOUS}" == true ]]; then
previous_issue_number=$(gh issue list \
--label "$LABELS" \
--json number \
--jq '.[0].number')
if [[ -n $previous_issue_number ]]; then
gh issue close "$previous_issue_number"
gh issue unpin "$previous_issue_number"
fi
fi
new_issue_url=$(gh issue create \
--title "$TITLE" \
--assignee "$ASSIGNEES" \
--label "$LABELS" \
--body "$BODY")
if [[ $PINNED == true ]]; then
gh issue pin "$new_issue_url"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TITLE: 📥 Maintenance - Airflow Python Base Image
ASSIGNEES:
LABELS: maintenance
BODY: |
> [!NOTE]
> This issue is created by a scheduled workflow.
### User Story
As an… engineer on the Analytical Platform
I need/want/expect to… keep the Airflow Python Base image up to date
So that… security / best practice etc
### Definition of Done
- [ ] Merge any open dependabot Pull Requests in the Ingestion repositories (noted below).
- [ ] In the [repository](https://github.com/ministryofjustice/analytical-platform-airflow-python-base), confirm that the [software](https://github.com/ministryofjustice/analytical-platform-airflow-python-base?tab=readme-ov-file#managing-software-versions) and [tests](https://github.com/ministryofjustice/analytical-platform-airflow-python-base/blob/main/test/container-structure-test.yml) are up-to-date.
- [ ] Create a new [release](https://github.com/ministryofjustice/analytical-platform-airflow-python-base/releases).
PINNED: false
CLOSE_PREVIOUS: false

0 comments on commit 453526f

Please sign in to comment.