Suggest IRIs upon term request #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Suggest IRI upon term request | |
on: | |
#issues: | |
# types: | |
# - labeled | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
add-comment: | |
#if: github.event.label.name == 'term request' | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache IRIs | |
id: cache-iris | |
uses: actions/cache@v4 | |
with: | |
path: iris | |
key: ${{ runner.os }}-iris | |
- name: generate IRI | |
run: | | |
# Keep generating random patterns until a non-existing one is found | |
while true; do | |
new_iri=$(bash scripts/src/generate_iri.sh) | |
# Check if the random pattern is not in the CACHE | |
if [[ ! iris =~ $new_iri ]]; then | |
echo "NEW_IRI=$new_iri" >> $GITHUB_ENV | |
echo $new_iri | |
break # Exit the loop once a non-existing IRI is found | |
fi | |
done | |
#- name: Add comment | |
# run: gh issue comment "$NUMBER" --body "$BODY" | |
# env: | |
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# GH_REPO: ${{ github.repository }} | |
# NUMBER: ${{ github.event.issue.number }} | |
# BODY: > | |
# Available IRI: {$env.NEW_IRI} |