|
1 | | -name: Process Sample Files and Create PR |
| 1 | +name: Generate Integration Docs and Create PR |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | paths: |
6 | 6 | - 'website/docs/sample-workflow-tests/**' |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - generate_docs_and_pr: |
| 9 | + generate_docs: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 |
|
12 | 12 | steps: |
|
26 | 26 | echo "New file detected: $ADDED_FILE" |
27 | 27 | echo "file_path=$ADDED_FILE" >> $GITHUB_ENV |
28 | 28 |
|
29 | | - - name: Show file name and content |
| 29 | + - name: Read file content |
30 | 30 | run: | |
31 | | - echo "Reading content of: ${{ env.file_path }}" |
| 31 | + echo "Reading: ${{ env.file_path }}" |
32 | 32 | cat "${{ env.file_path }}" |
33 | 33 | cp "${{ env.file_path }}" input_file.txt |
34 | 34 |
|
@@ -70,42 +70,35 @@ jobs: |
70 | 70 | -H "Content-Type: application/json" \ |
71 | 71 | -d "$PAYLOAD" | jq -r '.choices[0].message.content' > generated_doc.md |
72 | 72 |
|
73 | | - - name: Prepare output path and filename |
| 73 | + - name: Prepare target path |
74 | 74 | id: prepare_path |
75 | 75 | run: | |
76 | 76 | RAW_FILENAME=$(basename "${{ env.file_path }}") |
77 | 77 | INTEGRATION_NAME=$(echo "$RAW_FILENAME" | sed 's/\.[^.]*$//' | tr '[:upper:]' '[:lower:]') |
78 | | - TARGET_PATH="connect-data/reference/${INTEGRATION_NAME}.md" |
| 78 | + TARGET_PATH="website/docs/connect-data/reference/${INTEGRATION_NAME}.md" |
79 | 79 |
|
80 | | - echo "Creating path: $TARGET_PATH" |
81 | | - mkdir -p "$(dirname $TARGET_PATH)" |
| 80 | + echo "Target file: $TARGET_PATH" |
| 81 | + mkdir -p "$(dirname "$TARGET_PATH")" |
82 | 82 | cp generated_doc.md "$TARGET_PATH" |
83 | 83 |
|
84 | 84 | echo "integration_name=$INTEGRATION_NAME" >> $GITHUB_ENV |
85 | 85 | echo "target_path=$TARGET_PATH" >> $GITHUB_ENV |
86 | 86 |
|
87 | | - - name: Commit and push changes to new branch |
88 | | - run: | |
89 | | - BRANCH_NAME="auto/docs-${{ env.integration_name }}" |
90 | | -
|
91 | | - git config user.name "github-actions[bot]" |
92 | | - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
93 | | -
|
94 | | - git checkout -b "$BRANCH_NAME" |
95 | | - git add "${{ env.target_path }}" |
96 | | - git commit -m "docs: add integration reference for ${{ env.integration_name }}" |
97 | | - git push origin "$BRANCH_NAME" |
98 | | -
|
99 | | - - name: Create Pull Request |
| 87 | + - name: Commit and create PR |
100 | 88 | uses: peter-evans/create-pull-request@v5 |
101 | 89 | with: |
102 | 90 | token: ${{ secrets.GITHUB_TOKEN }} |
103 | 91 | title: "docs: add ${{ env.integration_name }} integration reference" |
104 | | - commit-message: "docs: add integration reference for ${{ env.integration_name }}" |
| 92 | + commit-message: "docs: add reference for ${{ env.integration_name }}" |
105 | 93 | branch: "auto/docs-${{ env.integration_name }}" |
106 | 94 | base: main |
| 95 | + add-paths: | |
| 96 | + ${{ env.target_path }} |
107 | 97 | body: | |
108 | | - This PR was automatically generated from a newly added sample file for **${{ env.integration_name }}**. |
| 98 | + This PR adds the generated integration reference for **${{ env.integration_name }}** to: |
| 99 | +
|
| 100 | + ``` |
| 101 | + /website/docs/connect-data/reference/${{ env.integration_name }}.md |
| 102 | + ``` |
109 | 103 |
|
110 | | - The integration reference documentation has been created at: |
111 | | - `/connect-data/reference/${{ env.integration_name }}.md` |
| 104 | + Generated automatically from sample workflow input. |
0 commit comments