Skip to content

Filter community resources #51

Filter community resources

Filter community resources #51

name: Filter community tools
on:
workflow_dispatch:
# the workflow it triggered when all tools are fetched
workflow_run:
workflows: ["Fetch all tools"]
types:
- completed
# the workflow it also triggered when the community definitions are changed
push:
paths:
- 'data/communities**'
branches: ["main"]
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "filter"
cancel-in-progress: false
permissions:
contents: write
jobs:
filter-all-tutorials:
name: Filter tutorials
runs-on: ubuntu-20.04
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
path: results
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install requirement
run: python -m pip install -r requirements.txt
- name: Run script
run: |
bash bin/get_community_tutorials.sh
- name: Commit results
# commit the new filtered data, only if stuff was changed
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true
MESSAGE: "Update results step: filter tutorials - commmit {sha}"
update-tools-to-keep-exclude:
name: Update tool to keep and exclude
runs-on: ubuntu-20.04
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
path: results
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install requirement
run: python -m pip install -r requirements.txt
- name: Run script
run: |
bash bin/update_tools_to_keep_exclude.sh
- name: Commit results
# commit the new filtered data, only if stuff was changed
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true
MESSAGE: "Update results step: update tool to keep and exclude - commmit {sha}"
filter-all-tools:
name: Filter all tools
runs-on: ubuntu-20.04
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
path: results
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install requirement
run: python -m pip install -r requirements.txt
- name: Run script
run: |
bash bin/get_community_tools.sh
- name: Commit results
# commit the new filtered data, only if stuff was changed
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true
MESSAGE: "Update results step: filter all tools - commmit {sha}"