From 57a2cfaa53d0eaef847233e0714d38e685cff7a2 Mon Sep 17 00:00:00 2001 From: Liv Dywan Date: Thu, 2 May 2024 16:20:03 +0200 Subject: [PATCH] Checkout individual state file to avoid recursion See: https://progress.opensuse.org/issues/158236 --- action.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/action.yaml b/action.yaml index 1bbf055..0cd12bf 100644 --- a/action.yaml +++ b/action.yaml @@ -18,6 +18,10 @@ inputs: description: Output folder for HTML files required: false default: 'gh-pages' + state: + description: Output folder for state keeping + required: false + default: 'state' redmine_api_key: description: The Redmine API key required: true @@ -48,9 +52,12 @@ runs: uses: actions/checkout@v4 with: ref: ${{ inputs.folder }} - path: ${{ inputs.folder }} - fetch-depth: '1' - - run: rm -rf ${{ inputs.folder }}/.git + path: ${{ inputs.state }} + # https://github.com/actions/checkout#fetch-only-a-single-file + sparse-checkout: | + state.json + sparse-checkout-cone-mode: false + - run: rm -rf ${{ inputs.state }}/.git shell: bash - name: Render Markdown from configured backlog queries run: | @@ -58,7 +65,7 @@ runs: echo "BACKLOG_STATUS=$?" >> "$GITHUB_ENV" env: REDMINE_API_KEY: ${{ inputs.REDMINE_API_KEY }} - STATE_FOLDER: ${{ inputs.folder }} + STATE_FOLDER: ${{ inputs.state }} WEBHOOK_URL: ${{ inputs.webhook_url }} shell: bash continue-on-error: true @@ -80,7 +87,6 @@ runs: shell: bash - name: Render HTML run: | - mkdir -p ${{ inputs.folder }} cd ${{ inputs.folder }} cat ../backlogger/head.html > index.html kramdown ../index.md >> index.html