Skip to content

Commit

Permalink
add schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 24, 2024
1 parent d57b032 commit 4f36e3b
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
name: Example/test maintenance (package-lock updating, formatting, linting)
on:
workflow_dispatch:
inputs:
signing-key-id:
required: true
type: string
default: C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0
schedule:
# Run at 10:00 UTC (4:00 AM MT) every day
- cron: '0 10 * * *'

jobs:
determine-signing-key:
runs-on: ubuntu-latest
outputs:
signing-key-id: ${{ steps.set-key.outputs.key }}
steps:
- id: set-key
run: echo "key=C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0" >> $GITHUB_OUTPUT

create-branch-prefix:
needs: determine-signing-key
uses: ./.github/workflows/create_branch_prefix.yml
with:
prefix: 'maintenance'
prefix: "maintenance-${{ format('yyyy-MM-dd', 'UTC') }}"
version: $(jq -r '.version' package.json)
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}

prepare-maintenance:
name: Prepare Maintenance
needs:
- create-branch-prefix
- determine-signing-key
runs-on: ubuntu-latest
outputs:
test-infos: ${{ steps.get-test-infos.outputs.test-infos }}
Expand Down Expand Up @@ -48,7 +56,7 @@ jobs:
branch-name: ${{ needs.create-branch-prefix.outputs.base-branch }}
commit-message: 'Example/test maintenance: formatting and linting'
gpg-signing-key: ${{ secrets.GPG_SIGNING_KEY }}
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}

- id: get-test-infos
uses: ./.github/actions/get_test_infos
Expand All @@ -59,6 +67,7 @@ jobs:
needs:
- prepare-maintenance
- create-branch-prefix
- determine-signing-key
name: Update dependencies for ${{ matrix.test.name }}
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -98,18 +107,19 @@ jobs:
commit-message: 'Example/test maintenance: update dependencies'
gpg-signing-key: ${{ secrets.GPG_SIGNING_KEY }}
create-branch: 'true'
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}

squash-branches:
needs:
- update-test-dependencies
- create-branch-prefix
- determine-signing-key
uses: ./.github/workflows/squash_branches.yml
with:
base-branch: ${{ needs.create-branch-prefix.outputs.base-branch }}
branch-prefix: ${{ needs.create-branch-prefix.outputs.branch-prefix }}
commit-message: 'Example/test maintenance: update dependencies'
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 4f36e3b

Please sign in to comment.