Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/doc-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
workflow_call:

permissions:
pull-requests: read
pull-requests: write
contents: read

env:
Expand Down Expand Up @@ -466,14 +466,14 @@ jobs:
echo "target_repo=${{ github.repository }}" >> "$GITHUB_OUTPUT"
echo "pr_number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "pr_sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
echo "artifact_name=${{ env.spelling_artifact }}" >> "$GITHUB_OUTPUT"
echo "comment_title=${{ env.spelling_comment_title }}" >> "$GITHUB_OUTPUT"
echo "artifact_name=${{ env.spellcheck_artifact }}" >> "$GITHUB_OUTPUT"
echo "comment_title=${{ env.spellcheck_comment_title }}" >> "$GITHUB_OUTPUT"
echo "reactions=confused" >> "$GITHUB_OUTPUT"

pr-comment-spelling-report:
name: Create or update comment
needs: pr-markdown-spelling-report
secrets: inherit
secrets: inherits
uses: ./.github/workflows/pr-comment.yml
with:
run_id: ${{ needs.pr-markdown-spelling-report.outputs.run_id }}
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
run: |
MESSAGE_FILE="${{ steps.download.outputs.download-path }}/${{ inputs.artifact_name }}"
SIZE=$(wc -c "${MESSAGE_FILE}")
SIZE=$(cat "${MESSAGE_FILE}"|wc -c)
if [[ "${SIZE}" -gt "${{ env.MAX_MESSAGE_SIZE }}" ]] ; then
# truncate the message up to MAX_MESSAGE_SIZE
head -c ${{ env.MAX_MESSAGE_SIZE }} "${MESSAGE_FILE}" > /tmp/truncated
Expand All @@ -134,13 +134,15 @@ jobs:
direction: last
token: ${{ secrets.GITHUB_TOKEN }}

- name: Acquire write access to PR
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
id: acquire_write_token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.CI_WORKFLOWS_PR_APP_ID }}
private-key: ${{ secrets.CI_WORKFLOWS_PR_APP_PRIVATE_KEY }}
#- name: Acquire write access to PR
# if: ${{ steps.check_pr.outputs.proceed == 'true'}}
# id: acquire_write_token
# uses: actions/create-github-app-token@v2
# with:
# app-id: ${{ secrets.CI_WORKFLOWS_PR_APP_ID }}
# private-key: ${{ secrets.CI_WORKFLOWS_PR_APP_PRIVATE_KEY }}
# owner: go-openapi
# repo: ${{ inputs.target_repo }}

- name: Create or update PR comment
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
Expand All @@ -152,7 +154,7 @@ jobs:
reactions-edit-mode: replace
body-path: ${{ steps.download.outputs.download-path }}/${{ inputs.artifact_name }}
edit-mode: replace
token: ${{ steps.acquire_write_token.outputs.token }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Notify
run: |
Expand Down
2 changes: 2 additions & 0 deletions ALL.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
This is a test of the spellcheck dictionary

# Swagger 2.0 specification schema

This folder contains the Swagger 2.0 specification schema files maintained here:
Expand Down
Loading