From 17ce887fc374e1104d8d6d78bb95a6f0f8697221 Mon Sep 17 00:00:00 2001 From: Kaiserdragon2 <8929967+Kaiserdragon2@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:07:47 +0100 Subject: [PATCH 1/6] Add to main for manual Trigger --- .github/workflows/RequestUpdate.yml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/RequestUpdate.yml diff --git a/.github/workflows/RequestUpdate.yml b/.github/workflows/RequestUpdate.yml new file mode 100644 index 0000000000..99c7d85709 --- /dev/null +++ b/.github/workflows/RequestUpdate.yml @@ -0,0 +1,57 @@ +name: Update Requests + +on: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '30 5 * * 0,3' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: write +concurrency: + group: 'updaterequest' + cancel-in-progress: false + +jobs: + Update_Requests: + environment: + name: Request-Update + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: Arcticons-Pages + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: 'pip' + - run: pip install -r .github/workflows/requirements.txt + + - name: Execute Python Script + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REQUEST_LIMIT: ${{ vars.REQUEST_LIMIT }} + MONTHS_LIMIT: ${{ vars.MONTHS_LIMIT }} + MIN_REQUESTS: ${{ vars.MIN_REQUESTS }} + SUBJECT_PREFIX: ${{ vars.SUBJECT_PREFIX }} + SUBJECT_SUFFIX: ${{ vars.SUBJECT_SUFFIX }} + IMAP_SERVER: ${{ secrets.IMAP_SERVER }} + IMAP_USERNAME: ${{ secrets.IMAP_USERNAME }} + IMAP_PASSWORD: ${{ secrets.IMAP_PASSWORD }} + run: | + mkdir mail + python .github/workflows/email_parser_auto.py mail newicons/appfilter.xml docs/extracted_png docs/assets/ + rm -r mail + - name: Commit changes + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add -A + git commit -m "Automated Request Update" + git push From 9df460e7551e6f757b96f24aecd34a22ecc9ac19 Mon Sep 17 00:00:00 2001 From: Kaiserdragon2 <8929967+Kaiserdragon2@users.noreply.github.com> Date: Sun, 5 Jan 2025 13:53:12 +0100 Subject: [PATCH 2/6] Run only on Arcticons Team --- .github/workflows/RequestUpdate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/RequestUpdate.yml b/.github/workflows/RequestUpdate.yml index 99c7d85709..127ba4c138 100644 --- a/.github/workflows/RequestUpdate.yml +++ b/.github/workflows/RequestUpdate.yml @@ -16,6 +16,7 @@ concurrency: jobs: Update_Requests: + if: github.repository == 'Arcticons-Team/Arcticons' environment: name: Request-Update runs-on: ubuntu-latest From 384ad17f25b34e871fb215d2a39cebfa0e9a14ce Mon Sep 17 00:00:00 2001 From: Kaiserdragon2 <8929967+Kaiserdragon2@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:00:42 +0100 Subject: [PATCH 3/6] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04824fa6b6..b65e233bd4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: parse_and_combine: needs: parse_appfilter - if: '!failure()' + if: ('!failure()' && ${{ github.event.workflow_run.conclusion == 'success' }} ) environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From a12f9f45ee496beaa2e7f5bb0684170f46130d57 Mon Sep 17 00:00:00 2001 From: Kaiserdragon2 <8929967+Kaiserdragon2@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:04:44 +0100 Subject: [PATCH 4/6] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b65e233bd4..17d240fc0f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: parse_and_combine: needs: parse_appfilter - if: ('!failure()' && ${{ github.event.workflow_run.conclusion == 'success' }} ) + if: ('!failure()' && (${{ github.event.workflow_run.conclusion == 'success' }} || github.event_name != 'workflow_run' )) environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From 74b7757b8f4858db333cd9466d0deb42a9309c2b Mon Sep 17 00:00:00 2001 From: Kaiserdragon2 <8929967+Kaiserdragon2@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:07:28 +0100 Subject: [PATCH 5/6] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17d240fc0f..6633abf488 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: parse_and_combine: needs: parse_appfilter - if: ('!failure()' && (${{ github.event.workflow_run.conclusion == 'success' }} || github.event_name != 'workflow_run' )) + if: ('!failure()' && (${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event_name != 'workflow_run' }} )) environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From f5e252d05579baa4e3d6f9674edc6582796665e9 Mon Sep 17 00:00:00 2001 From: Kaiserdragon2 <8929967+Kaiserdragon2@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:12:41 +0100 Subject: [PATCH 6/6] Update main.yml --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6633abf488..dd4f6dd589 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,12 @@ jobs: parse_and_combine: needs: parse_appfilter - if: ('!failure()' && (${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event_name != 'workflow_run' }} )) + if: | + !failure() && + ( + (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || + github.event_name != 'workflow_run' + ) environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }}