Manual resolution needed for sbpipe/*_pair_1 #223
This file contains hidden or 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: Handle resolved conflict | |
| on: | |
| issues: | |
| types: [closed] | |
| permissions: | |
| contents: write | |
| jobs: | |
| extract-id: | |
| runs-on: ubuntu-latest | |
| if: contains(join(github.event.issue.labels.*.name, ','), 'conflict') | |
| outputs: | |
| conflict_id: ${{ steps.extract.outputs.conflict_id }} | |
| steps: | |
| - name: Extract conflict ID from issue title | |
| id: extract | |
| run: | | |
| echo "Issue title: ${{ github.event.issue.title }}" | |
| CONFLICT_ID=$(echo "${{ github.event.issue.title }}" | sed -E 's/^Manual resolution needed for //') | |
| echo "conflict_id=$CONFLICT_ID" >> $GITHUB_OUTPUT | |
| extract-decision: | |
| runs-on: ubuntu-latest | |
| needs: extract-id | |
| if: contains(join(github.event.issue.labels.*.name, ','), 'conflict') | |
| outputs: | |
| decision: ${{ steps.set-output.outputs.decision }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Extract decision | |
| id: set-output | |
| run: | | |
| pip install requests | |
| pip install bson | |
| PYTHONPATH=$(pwd) python human_annotations/scripts/extract_decision.py "${{ github.repository }}" "${{ github.event.issue.number }}" "${{ needs.extract-id.outputs.conflict_id }}" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit and push updated log | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git add human_annotations/human_conflicts_log.jsonl | |
| git commit -m "Update human_conflicts_log.json for ${{ needs.extract-id.outputs.conflict_id }}" || echo "No changes to commit" | |
| git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |