The Friction-Utility Curve: Optimizing Funding Effectiveness via Quantitative Economic Friction #179
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: Publish approved content | |
| on: | |
| issues: | |
| types: [labeled] | |
| jobs: | |
| publish: | |
| if: github.event.label.name == 'approved' && contains(github.event.issue.labels.*.name, 'content') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - name: Detect content type from labels | |
| id: detect | |
| run: | | |
| LABELS='${{ toJSON(github.event.issue.labels.*.name) }}' | |
| for TYPE in app mechanism research case-study campaign; do | |
| if echo "$LABELS" | grep -q "\"$TYPE\""; then | |
| echo "type=$TYPE" >> "$GITHUB_OUTPUT" | |
| break | |
| fi | |
| done | |
| - name: Publish content | |
| if: steps.detect.outputs.type | |
| run: npx tsx scripts/publish-${{ steps.detect.outputs.type }}.ts ${{ github.event.issue.number }} | |
| - name: Create pull request | |
| if: steps.detect.outputs.type | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: "Add ${{ steps.detect.outputs.type }}: ${{ github.event.issue.title }}" | |
| branch: publish/issue-${{ github.event.issue.number }} | |
| title: "Publish: ${{ github.event.issue.title }}" | |
| body: | | |
| Auto-generated from issue #${{ github.event.issue.number }}. | |
| **Preview:** https://www.gitcoin.co/preview?issue=${{ github.event.issue.number }}&type=${{ steps.detect.outputs.type }} | |
| Closes #${{ github.event.issue.number }} | |
| - name: Comment on issue | |
| if: steps.detect.outputs.type | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.issues.createComment({ | |
| ...context.repo, | |
| issue_number: context.issue.number, | |
| body: `Content published! A pull request has been created and is ready for review.`, | |
| }); |