|
49 | 49 |
|
50 | 50 | - name: Extract information from Issue |
51 | 51 | id: extract |
| 52 | + env: |
| 53 | + ISSUE_BODY: ${{ github.event.issue.body }} |
52 | 54 | run: | |
53 | | - echo "${{ github.event.issue.body }}" > issue_body.txt |
| 55 | + echo "$ISSUE_BODY" > issue_body.txt |
54 | 56 | |
55 | 57 | echo "Extracted issue body:" |
56 | 58 | cat issue_body.txt |
@@ -86,34 +88,43 @@ jobs: |
86 | 88 | rm issue_body.txt |
87 | 89 |
|
88 | 90 | - name: Run the article generation script |
| 91 | + env: |
| 92 | + FILEID: ${{ steps.extract.outputs.fileid }} |
| 93 | + AUTHOR: ${{ steps.extract.outputs.author }} |
| 94 | + TAGS: ${{ steps.extract.outputs.tags }} |
89 | 95 | run: | |
90 | 96 | uv run python scripts/pandoc_google_doc.py \ |
91 | | - --fileid "${{ steps.extract.outputs.fileid }}" \ |
92 | | - --author "${{ steps.extract.outputs.author }}" \ |
93 | | - --tags "${{ steps.extract.outputs.tags }}" |
| 97 | + --fileid "$FILEID" \ |
| 98 | + --author "$AUTHOR" \ |
| 99 | + --tags "$TAGS" |
94 | 100 |
|
95 | 101 | - name: Commit and push generated article |
| 102 | + env: |
| 103 | + FILEID: ${{ steps.extract.outputs.fileid }} |
96 | 104 | run: | |
97 | 105 | git config user.name "github-actions[bot]" |
98 | 106 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
99 | 107 |
|
100 | | - BRANCH="articles/${{ steps.extract.outputs.fileid }}" |
| 108 | + BRANCH="articles/$FILEID" |
101 | 109 | git checkout -b "$BRANCH" |
102 | 110 |
|
103 | 111 | git add . |
104 | | - git commit -m "Generated article from Google Doc ID: ${{ steps.extract.outputs.fileid }}" |
| 112 | + git commit -m "Generated article from Google Doc ID: $FILEID" |
105 | 113 | git push origin "$BRANCH" |
106 | 114 |
|
107 | 115 | - name: Create Pull Request |
108 | 116 | id: create_pr |
109 | | - run: | |
110 | | - gh pr create \ |
111 | | - --title "Article draft: ${{ steps.extract.outputs.title }}" \ |
112 | | - --body "This PR was automatically generated from issue #${{ github.event.issue.number }}. Closes #${{ github.event.issue.number }}" \ |
113 | | - --head "articles/${{ steps.extract.outputs.fileid }}" \ |
114 | | - --base main |
115 | 117 | env: |
116 | 118 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 119 | + ARTICLE_TITLE: ${{ steps.extract.outputs.title }} |
| 120 | + FILEID: ${{ steps.extract.outputs.fileid }} |
| 121 | + ISSUE_NUMBER: ${{ github.event.issue.number }} |
| 122 | + run: | |
| 123 | + gh pr create \ |
| 124 | + --title "Article draft: $ARTICLE_TITLE" \ |
| 125 | + --body "This PR was automatically generated from issue #$ISSUE_NUMBER. Closes #$ISSUE_NUMBER" \ |
| 126 | + --head "articles/$FILEID" \ |
| 127 | + --base main |
117 | 128 | - name: Comment on the original Issue |
118 | 129 | uses: peter-evans/create-or-update-comment@v3 |
119 | 130 | with: |
|
0 commit comments