1.1 - Define Goals and Roadmap #524
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: VeriSphere Bounty Sync | |
| on: | |
| issues: | |
| types: [opened, labeled, closed, reopened, edited] | |
| issue_comment: | |
| types: [created] | |
| pull_request: | |
| types: [closed] | |
| workflow_dispatch: | |
| jobs: | |
| sync-bounty: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Write GCP key.json | |
| env: | |
| GOOGLE_CREDENTIALS_JSON: ${{ secrets.GOOGLE_CREDENTIALS_JSON }} | |
| run: | | |
| mkdir -p .verisphere/scripts | |
| echo "$GOOGLE_CREDENTIALS_JSON" > .verisphere/scripts/key.json | |
| - name: Install Python deps | |
| run: | | |
| pip install --upgrade pip | |
| pip install -r .verisphere/scripts/requirements.txt | |
| ########################################################################### | |
| # Fetch FULL metadata, including body, title, labels, URL, etc. | |
| ########################################################################### | |
| - name: Fetch issue metadata | |
| id: fetch | |
| shell: bash | |
| run: | | |
| ISSUE_NUMBER="${{ github.event.issue.number }}" | |
| if [ -z "$ISSUE_NUMBER" ]; then | |
| echo "labels=[]" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| curl -s \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER" \ | |
| > issue.json | |
| TITLE=$(jq -r '.title' issue.json) | |
| URL=$(jq -r '.html_url' issue.json) | |
| BODY=$(jq -r '.body // ""' issue.json) | |
| LABELS=$(jq -c '.labels' issue.json) | |
| ACTOR="${{ github.actor }}" | |
| STATUS="${{ github.event.action }}" | |
| REPO="${{ github.repository }}" | |
| { | |
| echo "title<<EOF" | |
| echo "$TITLE" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| { | |
| echo "body<<EOF" | |
| echo "$BODY" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| { | |
| echo "url<<EOF" | |
| echo "$URL" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| { | |
| echo "labels<<EOF" | |
| echo "$LABELS" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| { | |
| echo "actor<<EOF" | |
| echo "$ACTOR" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| { | |
| echo "status<<EOF" | |
| echo "$STATUS" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| { | |
| echo "repo<<EOF" | |
| echo "$REPO" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| ########################################################################### | |
| # Append row to Google Sheet — only if bounty label exists | |
| ########################################################################### | |
| - name: Append to Google Sheet | |
| if: contains(join(fromJson(steps.fetch.outputs.labels).* .name, ','), 'bounty') | |
| env: | |
| SHEET_ID: ${{ secrets.SHEET_ID }} | |
| GOOGLE_CREDENTIALS_JSON: ${{ secrets.GOOGLE_CREDENTIALS_JSON }} | |
| run: | | |
| python .verisphere/scripts/update_sheet.py \ | |
| --sheet "$SHEET_ID" \ | |
| --title "${{ steps.fetch.outputs.title }}" \ | |
| --body "${{ steps.fetch.outputs.body }}" \ | |
| --labels "${{ steps.fetch.outputs.labels }}" \ | |
| --actor "${{ steps.fetch.outputs.actor }}" \ | |
| --status "${{ steps.fetch.outputs.status }}" \ | |
| --repo "${{ steps.fetch.outputs.repo }}" \ | |
| --url "${{ steps.fetch.outputs.url }}" | |