diff --git a/.github/workflows/RequestUpdate.yml b/.github/workflows/RequestUpdate.yml new file mode 100644 index 0000000000..127ba4c138 --- /dev/null +++ b/.github/workflows/RequestUpdate.yml @@ -0,0 +1,58 @@ +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: + if: github.repository == 'Arcticons-Team/Arcticons' + 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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04824fa6b6..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()' + 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 }}