Skip to content

.github/workflows/fact-check.yml #478

.github/workflows/fact-check.yml

.github/workflows/fact-check.yml #478

Workflow file for this run

on:
issue_comment:
types: [created]
permissions:
contents: read
issues: read
pull-requests: write
jobs:
permission-check-job:
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '/qualitycheck')
outputs:
permission: ${{ steps.permissions-check.outputs.defined }}
steps:
- name: Check for Secret availability
id: permissions-check
shell: bash
run: |
echo "defined=${{ contains(fromJSON(secrets.WIKI_REVIEWERS), github.actor) }}" >> $GITHUB_OUTPUT;
fact-check:
runs-on: ubuntu-latest
name: "Verify statements in content diff for truthness"
needs: [permission-check-job]
if: needs.permission-check-job.outputs.permission == 'true'
steps:
- uses: actions/checkout@v3
- name: Cache Python
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
- name: Install package
run: pipx install poetry && poetry install --no-interaction
- name: Run script
run: |
poetry run fact-check \
--pull-url "${{ github.event.issue.pull_request.url }}" \
--github-token "${{ secrets.GITHUB_TOKEN }}" \
--openai-key "${{ secrets.OPENAI_KEY }}" \
--content-path "content"