Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Automated Dashboard Updates #2450

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/RequestUpdate.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down