From 4f36e3b53cb3f32172ba7b4e57a511e6b7155864 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Mon, 23 Dec 2024 21:02:12 -0700 Subject: [PATCH] add schedule --- .github/workflows/maintenance.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index d3818b154a..dbe5ef14a6 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -1,19 +1,26 @@ 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 }} @@ -21,6 +28,7 @@ jobs: name: Prepare Maintenance needs: - create-branch-prefix + - determine-signing-key runs-on: ubuntu-latest outputs: test-infos: ${{ steps.get-test-infos.outputs.test-infos }} @@ -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 @@ -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: @@ -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 }}